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.
Q10475 - Info: How do I get the position of a row in the datasource from CurrentCell''s rowIndex?
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;
when i run this code, i got the following errors. Please help to solve this problem
The type or namespace name ''Element'' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name ''Record'' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name ''row'' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name ''Table'' could not be found (are you missing a using directive or an assembly reference?)
ADAdministrator Syncfusion Team August 24, 2004 09:39 AM UTC
Here are the two namespaces you need to use the GridGrouping support in our libraries.
using Syncfusion.Grouping;
using Syncfusion.Windows.Forms.Grid.Grouping;
>>CustomersDataRow row = dataSoure.Rows[dataRowPos];
This code should be replaced with whatever strongly typed dataset you are using, something similar to:
DataRow dr = this.dataSet1.Tables["MyTable"].Rows[dataRowPosition];
But there is a simpler way to do it if you datasource is a DataTable (or DataView). Once you have the Record. you can use
DataRowView drv = r.GetData() as DataRowView;
Console.WriteLine(drv[0].ToString() + " " + drv[1].ToString());