Hi,
I am refreshing sorting when I add new items in my grid. It works fine when items are not grouped. In case of grouping this refreshing doesn't work or new items are not placed in sorted order. I am refreshing sorting like this:
EventViewDg.Records.RefreshSort();
Any idea how to fix that?
Thanks,
Imad.
Hello Imad,
Thank you for your post. I have been looking into it and I can suuegst you handle the XamDataGrid’s InitializeRecord event and add the following code in its handler:
e.Record.RefreshSortPosition();
Instead of calling the Records Collection’s RefreshSort method. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hi Stefan,
InitializeRecord event never executes in my case, as I am just adding new row in observablecollection of grid instead of changing any cell in grid.
Here is the explanation of InitializeRecord event from one of the post on infragistics forum:
"When the grid receives a notification that a property on data item changes it will raise the InitializeRecord event where the ReInitialize property of the InitializeRecordEventArgs is set to true. You could listen to the InitializeRecord event and call RefreshSortPosition on the Record."
Any other solution that I can try to sort new items in grid when items are grouped?
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
If you could send me an isolated sapmple project, where this is reproduced, I will be able to investigate it further for you.
I am still looking for a solution for this. I also tried:
layout.DataPresenter.InitializeRecord += new EventHandler<InitializeRecordEventArgs>(Dg_InitializeRecord);
but didn't work. Might be something in my grid.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Since this is not a known issue I cannot be completely sure what may cause it, but if you send me an isolated sample project, where this is reproduced, I will be able to investigate it further for you.