If you want to get at the recrods in a GriNestedTable, you need to drill down until there is no longer a gridnestedtable as the element being looked at.
int i = 0;
foreach(Element el in this.gridGroupingControl1.Table.Elements)
{
Console.WriteLine("{0}-{1}", i, el.GetType());
i += 1;
if(el != null)
{
if(el is GridRecord)
{
DataRowView drv = (el as Record).GetData() as DataRowView;
Console.WriteLine(drv[1].ToString()); //show column 2
}
else if(el is GridNestedTable)
{
GridNestedTable gnt = el as GridNestedTable;
GridNestedTable gnt1 = gnt;
while(gnt1 != null && gnt1.ChildTable != null)
{
gnt = gnt1;
gnt1 = gnt.ChildTable.ParentTable.CurrentElement as GridNestedTable;
}
foreach(GridRecord r in gnt.ChildTable.ParentTable.Records)
{
DataRowView drv = r.GetData() as DataRowView;
if(drv != null)
Console.WriteLine(drv[1].ToString()); //show column 2
}
}
}
}