Hi,
In my data grid, I have two rows, I bind record selector to index and I see row number 1 and 2 on the window.
After I add a new row, if I leave the row to be added to the bottom, then new row shows number 3 and the existing ones still show 1 and 2, this is fine. And if I keep adding new rows, the will show row number 4, 5, etc.
But after row is added (in code), I did a sort programmatically, which always moves new row to the top. Now the problem comes:
If before I add row, my current selected row is row 1, then after row is added and sorted, the row numbers become 1, 1, 3.
If before I add row, my current selected row is row 2, then after row is added and sorted, the row numbers become 1, 2, 2.
Notice the row number does not get changed for whatever row that is currently selected.
This seems to be a bug to me.
Please advice,
Thanks,
Yu
Hello Yu,
The VisibleIndex property is a lazy get property, so that is why it does not update. I am attaching a small project of how this can be resolved using a MultiValueConverter and a dummy dependency property which is used to update the binding.
For the RecordIndexXDG sample I added Sorting event with Code this.DummeyValue++; as follows.
However it is not showing proper RowIndex.
What Should be done in order to display proper index when Sorting is applied to a column?
private
void xamDataGrid1_Sorting(object sender, Infragistics.Windows.DataPresenter.Events.SortingEventArgs e){
this.DummyValue++;
}
You should use sorted event instead of sorting. Also I put increment operation in dispatcher thread, because sometimes it cause thread access exception.
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action( delegate() { this.DummyValue++; } ));
hi ,
I worked the solution given above and the row numbering works fyn .But I have enabled "filter option" in the grid which occupies row number 1.Data occupies from row number2 . So how to disable the row numbering for "Filter option row" and start numbering from data rows .For ur reference i hv attached an screen shot.