Hi,
DataItems.Add() Method throwing a IndexOutOfRange Exception.
Below are the series of calls that i made,
1. DataItems.Add() -- added 10 records, I could see 10 records.
2. Applied filter via UI -- now i could see 5 records, and rest 5 hidden. (Awesome filtering options - Xaml code for enabling filter - AllowRecordFiltering="true" FilterUIType="LabelIcons" )
3. DataItems.Clear() --
4. DataItems.Add() -- Trying to add another 10 records.
Throwing a IndexOutOfRange Exception, while adding 6th record.
Is this an issue with XamDataGrid or am i doing some thing wrong.
Regards.
Hello,
Try wrapping the objects that you add in the XamDataGrid in a collection and set the DataSource property and not add them in the DataItems collection.
For example, add items in a BindingList<T> collection and then set the XamDataGrid's DataSource property to this BindingList. This should be working as expected.
When adding new items, add them directly in the collection.