DataGrid
-
I am using datagrid to display data with Paging to move one page to another page. I have a delete button also, which is used to delete all records which user selected in datagrid with the help of check box. But when I select all records of Last page and Try to delete it gives Error. Error: Invalid current PageIndex value. It must be>=0 and
-
I am using datagrid to display data with Paging to move one page to another page. I have a delete button also, which is used to delete all records which user selected in datagrid with the help of check box. But when I select all records of Last page and Try to delete it gives Error. Error: Invalid current PageIndex value. It must be>=0 and
It may be due to reason that your page index get changed after delision. after delision set current page index as 1
-
I am using datagrid to display data with Paging to move one page to another page. I have a delete button also, which is used to delete all records which user selected in datagrid with the help of check box. But when I select all records of Last page and Try to delete it gives Error. Error: Invalid current PageIndex value. It must be>=0 and
-
I am using datagrid to display data with Paging to move one page to another page. I have a delete button also, which is used to delete all records which user selected in datagrid with the help of check box. But when I select all records of Last page and Try to delete it gives Error. Error: Invalid current PageIndex value. It must be>=0 and
Place the following check exactly before calling the DataGrid.DataBind() method: // Get the total number of records returned from the database table. int totalRecords = Dataset.Tables[Index].Rows.Count; int totalRecordsAssumption = DataGrid.PageSize * DataGrid.CurrentPageIndex; if( totalRecords <= totalRecordsAssumption && totalRecords != 0 ) { DataGrid.CurrentPageIndex = DataGrid.CurrentPageIndex - 1; } Hopefully this will solve your problem!! Tell me if u have any problems with it Regards ☺«««DTA»»»☺