Hi,
We are using Radgridview with CheckBox and also we have added the CheckAll and UnCheckAll button. We have finished this CheckAll and UnCheckAll functionalities using looping with grid.rows.count, but when we are filter the row it shows the total rows count and also getting the exception like 'Index 145 is either negative or above rows count.'. Refer the below code and kindly let me know how we have to solve this issue.
CheckAll:
Regards,
Murali.S
We are using Radgridview with CheckBox and also we have added the CheckAll and UnCheckAll button. We have finished this CheckAll and UnCheckAll functionalities using looping with grid.rows.count, but when we are filter the row it shows the total rows count and also getting the exception like 'Index 145 is either negative or above rows count.'. Refer the below code and kindly let me know how we have to solve this issue.
CheckAll:
for
(int i = 0; i < radGrid.Rows.Count; i++)
{
radGrid.Rows[i].Cells[
"-"].Value = Boolean.TrueString;
item = radGrid.Rows[i].DataBoundItem;
if (!this.selectedRows.Contains(item))
this.selectedRows.Add(item);
}
UnCheckAll:
this
.selectedRows.Clear();
for (int i = 0; i < radGrid.Rows.Count; i++)
{
radGrid.Rows[i].Cells[
"-"].Value = Boolean.FalseString;
}
Regards,
Murali.S