Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
13280 | Apr 24,2004 07:20 AM UTC | Apr 27,2004 04:55 PM UTC | WinForms | 8 |
![]() |
Tags: Grouping |
Record r = grdQuote.Table.CurrentRecord;
Object data = r.GetData();
If you need selected records, not sure why r.GetData() returns null.
Can you check what
grdQuote.Table.Records.IndexOf(r);
and
grdQuote.Table.UnsortedRecords.IndexOf(r);
returns and let me know?
The value returned by grdQuote.Table.UnsortedRecords.IndexOf(r) is the original row index in the datasource.
You could use that value to look up the datarow in the dataset, e.g. dataTable.Rows[unsortedRecordRowIndex]
Stefan
grdQuote.GetTable("MyChildTableName").CurrentRecord;
- or -
Element el = grdQuote.Table.CurrentElement;
NestedTable nt = el as NestedTable;
if (nt != null)
el = nt.ChildTable.ParentTable.CurrentElement;
If you have even more levels, you could do that in a loop:
Element el = grdQuote.Table.CurrentElement;
NestedTable nt = el as NestedTable;
while (nt != null)
{
el = nt.ChildTable.ParentTable.CurrentElement;
nt = el as NestedTable;
}
Stefan
>Hi againg.
>grdQuote.Table.CurrentRecord works correctly if selected row is a row of top level table.. But my dataset contains two tables. And if I select a row in the nested table grdQuote.Table.CurrentRecord returns null.
> This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.