I have a checkbox for all rows in the grid. I want the user to be able to delete multiple rows by selecting as many as they want and then hit "delete." Kind of like email in Gmail/Yahoo, etc.
I have two issues.
One, I get a warning for every row that the user tries to delete. Can I suppress this warning? I can't find the setting anywhere.
Two, when the last row tries to delete in my foreach loop, I get an error:
InvalidaOperationException... Any idea what's going on here and how to fix this? It happens on the last selected is to be deleted... Please let me know your thoughts. I seearched the forums and couldn't find anything.
Hi Jit,
You should post this in the appropriate WPF forum. Thi forum is for the Windows Forms grid, so I'm afraid I can't help you with XamDataGrid.
I'm getting the same error . But in my case I'm not deleting any rows . I'm removing column from front end from xam datagrid . And when again try to bind data to xam datagrid It's throws unhandled exception "Enumerator Has Exhasued"
at Infragistics.Collections.SparseArray.CreateItemEnumerator.EnsureNotExhausted() at Infragistics.Collections.SparseArray.CreateItemEnumerator.System.Collections.IEnumerator.MoveNext() at Infragistics.Windows.DataPresenter.RecordCollectionBase.RecordEnumeratorBase.MoveNext() at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.OutOfViewRecordEnumerable.Enumerator.MoveNext() at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.RecordEnumeratorBase.MoveNext()
Any thing I'm missing ?
Another option would be to select the rows and call the DeleteSelected method on the grid.
Got ya, well and I am going to eventually be saving this data offline, so yes I agree it needs to be done. I'll do it now so that I can delete my rows more efficiently. Thanks for the advise..
When building a list (of any type, combo, grid etc) it is important to make sure that you pass a ID that can be referenced by the grid and data at the same time this is just a good habbit as if you have to access the data for any means (ie: update/insert,select from where) you have the corosponding record...
You need to go back and add a UID to each row and will make your life A LOT easier as the grid is just a repensitation of your database nothing more...