paging dataGrid events
-
hello you all, I have a problem: I have a dataGrid with two events: 1. public void DataGrid1_ChooseLine(object sender, DataGridCommandEventArgs e) { try{ complaintId = Convert.ToInt32(e.Item.Cells[6].Text); } catch(Exception e) { } } and: 2. public void changePage(Object sender, DataGridPageChangedEventArgs e) { DataGrid1.CurrentPageIndex = e.NewPageIndex; DataGrid1.DataSource = dataSet; DataGrid1.DataBind(); } each of them works wonderful alone, but when I use them both I get this exception: "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values..." what can be the problem and how can I change it to work? thank you very much for your help, sharon.
-
hello you all, I have a problem: I have a dataGrid with two events: 1. public void DataGrid1_ChooseLine(object sender, DataGridCommandEventArgs e) { try{ complaintId = Convert.ToInt32(e.Item.Cells[6].Text); } catch(Exception e) { } } and: 2. public void changePage(Object sender, DataGridPageChangedEventArgs e) { DataGrid1.CurrentPageIndex = e.NewPageIndex; DataGrid1.DataSource = dataSet; DataGrid1.DataBind(); } each of them works wonderful alone, but when I use them both I get this exception: "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values..." what can be the problem and how can I change it to work? thank you very much for your help, sharon.
-
hello you all, I have a problem: I have a dataGrid with two events: 1. public void DataGrid1_ChooseLine(object sender, DataGridCommandEventArgs e) { try{ complaintId = Convert.ToInt32(e.Item.Cells[6].Text); } catch(Exception e) { } } and: 2. public void changePage(Object sender, DataGridPageChangedEventArgs e) { DataGrid1.CurrentPageIndex = e.NewPageIndex; DataGrid1.DataSource = dataSet; DataGrid1.DataBind(); } each of them works wonderful alone, but when I use them both I get this exception: "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values..." what can be the problem and how can I change it to work? thank you very much for your help, sharon.
-
usually the debugger tells you, in which line exactly the exception was thrown. which line is it? :wq
-
the line that debugger tells me is: complaintId = Convert.ToInt32(e.Item.Cells[6].Text); in chooseLine event i.e. he goes to the wrong event. why???