PageIndex change gives error from 2nd to 1st page
-
With only one record on my 2nd page in my datagrid, when I go from page 2 to page 1 in my Datagrid (ASP.NET v1.1), I get: Input string was not in a correct format. [FormatException: Input string was not in a correct format.] Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +193 Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +92 [InvalidCastException: Cast from string "" to type 'Integer' is not valid.] Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +206 Work_PackageVBConvert_P3E.SARESTableSubform.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) +185 System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +109 System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138 System.Web.UI.Page.ProcessRequestMain() +1292 **************************************************************** I have no idea what's going on or why this is happening. If I add another record to my datagrid, and now I have two rows on my second page, I can go to the first page successfully. The PageIndexChanged routine is simply: DataGrid1.CurrentPageIndex = e.NewPageIndex Call DG() Any ideas? Thanks!
-
With only one record on my 2nd page in my datagrid, when I go from page 2 to page 1 in my Datagrid (ASP.NET v1.1), I get: Input string was not in a correct format. [FormatException: Input string was not in a correct format.] Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +193 Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +92 [InvalidCastException: Cast from string "" to type 'Integer' is not valid.] Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +206 Work_PackageVBConvert_P3E.SARESTableSubform.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) +185 System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +109 System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138 System.Web.UI.Page.ProcessRequestMain() +1292 **************************************************************** I have no idea what's going on or why this is happening. If I add another record to my datagrid, and now I have two rows on my second page, I can go to the first page successfully. The PageIndexChanged routine is simply: DataGrid1.CurrentPageIndex = e.NewPageIndex Call DG() Any ideas? Thanks!
AFAIF many people have the similar problem and one of the reasons is the bug in the ASP.NET 1.1, so you may want to search for the Microsoft KB. However, the error stack tells me that the control was deleting something as the DeleteCommand event gets fired ????
-
AFAIF many people have the similar problem and one of the reasons is the bug in the ASP.NET 1.1, so you may want to search for the Microsoft KB. However, the error stack tells me that the control was deleting something as the DeleteCommand event gets fired ????
...and that's what I couldn't figure out as far as the DeleteCommand getting fired. When there are two records on the 2nd page, there's no exception thrown when I click the #1 page link. If I delete one record from the 2nd page and now there's only 1 record on that page, the exception get's thrown when I click the link to go to page #1. Why does the DeleteCommand get fired when I click the page #1 link? I tested my original datagrid, and it doesn't do this...it's works fine. The only difference is the edit item template for this current datagrid where I put two dropdown lists and two text boxes in one column, so the user didn't have to scroll horizontally. The original datagrid, which changes my 4th text box/column to a ddl, and my 6th textbox/column to a ddl doesn't throw any errors. Weird......but at least it's a better UI than before, and I just display a tiny error message. Thanks!