The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I think this is supposed to be easy. What am I doing wrong?
I have a databound grid and certain cells are colored based on data in the row. Before sorting everything is fine. After clicking a header, the data is resorted but the colors don't change because I'm not relating the new row positions to the data correctly.
Inside PrepareViewStyleInfo event I'm getting the CurrencyManager (cm) and then
DataView dv = cm.List as DataView; int dataIndex = this.grid.Binder.RowIndexToListManagerPosition(e.RowIndex);
This always returns the same dataIndex for a given e.RowIndex no matter what the sort order is and so the dv[dataIndex].Row is always the same for the same e.rowIndex regardless of sort order. (?)
HAhaneefm Syncfusion Team June 13, 2007 07:01 PM UTC
Hi Dave,
The RowIndexToListManagerPosition is required if you have multi-row records as in the Grid\Samples\DataBound\MultiRowRecord sample. Otherwise, you can use the simpler RowIndexToPosition method to retrieve the position. Below is a code snippet
DataView dv = cm.List as DataView; int position = this.grid.Binder.RowIndexToPosition(e.RowIndex); DataRow dr = dv[position].Row;
Best regards, Haneef
DWDave WilkinsJune 13, 2007 07:07 PM UTC
Thanks. I tried that and it seems to work.
You are a star - thanks for getting back to me so quickly.
>Hi Dave,
The RowIndexToListManagerPosition is required if you have multi-row records as in the Grid\Samples\DataBound\MultiRowRecord sample. Otherwise, you can use the simpler RowIndexToPosition method to retrieve the position. Below is a code snippet
DataView dv = cm.List as DataView; int position = this.grid.Binder.RowIndexToPosition(e.RowIndex); DataRow dr = dv[position].Row;