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.
How do I derive the position of a row in the datasource from CurrentCell.RowIndex?
I''m looking for something like the GDBG''s RowIndexToListManagerPosition.
I''m in a handler for TableControlCellDoubleClick and I need to know the primary key of the row to display a detail form.
Thanks,
Sean
ADAdministrator Syncfusion Team April 20, 2004 08:49 PM UTC
Based on the row index you can get the element displayed at that row. If it is a record row then the parent records unsorted position is the underlying DataRow position.
Example:
Table table = e.TableControl.Table;
Element el = table.DisplayElements[e.rowIndex];
Record r = el.ParentRecord;
int dataRowPos = table.UnsortedRecords.IndexOf(r);
CustomersDataRow row = dataSoure.Rows[dataRowPos];
string id = row.CustomerId;
The main point here is that any row in the grid has 1-to-1 association with a displayelement of the engine table.
And for any record you can quickly identify its original position in the datasource with the UnsortedRecords.IndexOf method.
Stefan