Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6926543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:55:54+00:00 2026-05-27T10:55:54+00:00

When I am deleting a row from grid view I am getting following error.

  • 0

When I am deleting a row from grid view I am getting following error. “Specified argument was out of the range of valid values.Parameter name: value “.
The following is the Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value]
   System.Web.UI.WebControls.GridView.set_SelectedIndex(Int32 value) +1353411
   System.Web.UI.WebControls.GridView.HandleDeleteCallback(Int32 affectedRows, Exception ex) +368
   System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +137
   System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +714
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +869
   System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Please suggest me.

No. I didnt set set any index manually.My code sample as follows:

‘>

‘ >

            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="srcData" runat="server" ConnectionString="<%$ ConnectionStrings:GermanyCockpitDB %>"
            SelectCommand="SP_BPGetData" SelectCommandType="StoredProcedure"
            OnSelecting="srcBP_Selecting" DeleteCommand="SP_BPDeleteRecord"
            DeleteCommandType="StoredProcedure" OnDeleting="srcData_deleting">
            <SelectParameters>
                <asp:Parameter Name="Manager" Type="String" />
                <asp:Parameter Name="Period1" Type="String" />
                <asp:Parameter Name="Period2" Type="String" />
                <asp:Parameter Name="Period3" Type="String" />
                <asp:Parameter Name="Period4" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="ManagerName" Type="String" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="AName" Type="String" />
            </DeleteParameters>
        </asp:SqlDataSource><br /><br />  protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        gvData.DataSourceID = "srcData";
        gvData.DataBind();
    }

}protected void srcData_deleting(object sender, SqlDataSourceCommandEventArgs e)
{
    e.Command.Parameters["@ManagerName"].Value = "Sample";
}

protected void srcBP_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
    e.Command.Parameters["@ReportsToManager"].Value = "Sample";
    e.Command.Parameters["@Period1"].Value = "0";
    e.Command.Parameters["@Period2"].Value = "1";
    e.Command.Parameters["@Period3"].Value = "2";
    e.Command.Parameters["@Period4"].Value = "3";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:55:55+00:00Added an answer on May 27, 2026 at 10:55 am

    it seems you’re trying to set the selectedindex to a wrong index. Do you set it manually somewhere in your delete callback or pageload(prender,…)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting exception by deleting a row from the table view. - (NSInteger)numberOfSectionsInTableView:(UITableView
i have a grid-view, which contains an asp image-button for deleting row, i want
Deleting a row from a view, will it delete the appropriate rows from the
I am experiencing issues with deleting a row / data record from an SQLite
Before deleting a row from a table, is there any simple way to check
When deleting a row by its PrimaryKey from a table, I get about 44472
My application crashes when I'm deleting row from table. Here is my sources where
I'm trying to delete a row from my table view and so far have
I am deleting a row (user) from the table Accounts and I am trying
I am deleting a row from gridview for which i have used gridview's default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.