Namespace for Table, Element and CustomersDataRow

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?)

1 Reply

AD Administrator 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());

Loader.
Up arrow icon