Hello,
I`m using Q3 2008 WinForms, And i use RadGridView and wanna Remove some rows when user click on a bottum on form. I used this code to remove rows one by one.
before this code i`m using foreach statement but in two statement i have problem whit Removing
when one row was deleted SelectedRows Collection was change and exception occord in runtime.
Regards
Hamid
I`m using Q3 2008 WinForms, And i use RadGridView and wanna Remove some rows when user click on a bottum on form. I used this code to remove rows one by one.
| DialogResult mr = new DialogResult(); |
| mr = MessageBox.Show("Are U Sure?"); |
| if (mr == DialogResult.OK) |
| { |
| Telerik.WinControls.UI.GridViewDataRowInfo Row; |
| int RCount = GridHdr.SelectedRows.Count(); |
| for (int I = RCount - 1; I > -1; I--) |
| { |
| Row = (Telerik.WinControls.UI.GridViewDataRowInfo)GridHdr.SelectedRows[I]; |
| Row.Delete(); |
| BindingSourceHdr.EndEdit(); |
| AdapterHdr.Update(dBDataSet); |
| } |
| } |
before this code i`m using foreach statement but in two statement i have problem whit Removing
| foreach(GridViewDataRowInfo Row in GridHdr.SelectedRows) |
| { |
| Row.Delete(); BindingSourceHdr.EndEdit(); AdapterHdr.Update(dBDataSet); |
| } |
Regards
Hamid