I want to change the position of two rows
the itemsource is binding to Columns, item is currentItem,
the code :
int index = Columns.IndexOf(item) - 1;
Columns.Remove(item);
Columns.Insert(index, item);
now i must reset the source and the UI refresh
Columns = Columns.ToList().OrderBy(t => t.column_order) as ObservableCollection<Column>
Is any way tochange the position by not refresh ui?
5 Answers, 1 is accepted
Provided your Columns collection implements the INotifyCollectionChanged interface, any changes made to it should be reflected in RadGridView. I'm attaching a sample project in which, using the code you provided, I'm successfully able to swap the items and notify RadGridView about it.
Could you please have a look at the attached project and let me know whether I've missed something important? If that is the case, please let me know and I will gladly assist you further.
Regards,
Dilyan Traykov
Telerik by Progress
Thanks for your answer
I'm sorry i missed an important thing
i group the gridview by ColumnGroupDescriptor
<telerik:RadGridView.GroupDescriptors>
<telerik:ColumnGroupDescriptor x:Name="columnGroupDescriptor" Column="{Binding Columns[\ContactTitleWithConverter\], ElementName=ESColumnGrid}" SortDirection="Ascending"/>
</telerik:RadGridView.GroupDescriptors>
in your demo code i change a row cell data as same as another row and drag the column header to group
and the issue is also exist
Is there any solution for this
I find the solution use ColumnGroupDescriptor's ResumeNotifications mothed
columnGroupDescriptor.ResumeNotifications();
thank you very much!
ResumeNotifications can change the two item's index but the GridView is scroll to top
how to let the scrollbar keep the position
Could you please let me know how I need to modify the project from my previous post as well as what action steps I should take in order to reproduce the issue you've described as I am currently unable to do so?
Thank you in advance for your cooperation on the matter.
Regards,
Dilyan Traykov
Telerik by Progress