Hi,
Im displaying a celltooltip when the mouse moves over a cell, but I need to go back to the underlying table (which might be nested). How do I know from the underlying table?
thanks
John
HA
haneefm
Syncfusion Team
May 31, 2007 05:30 PM UTC
Hi John,
You can try these code:
GridTableControl tControl = sender as GridTableControl;
string tName = tControl.TableDescriptor.Name;
Console.WriteLine(tableControl.TableDescriptor.Name);
GridTable tTable = tControl.Table;
Console.WriteLine("Table Name = >" + tName);
//For getting the Record info.
foreach (Record r in tTable.Records)
{
Console.WriteLine(r.Info);
}
if want to get the underlying datatable, you can use GetCurrencyManager method. Below is a code snippet
CurrencyManager cm = tTable.GetCurrencyManager();
DataView dv = cm.List as DataView;
if( dv != null )
Console.WriteLine( dv.Table.TableName +":::" + e.TableControl.TableDescriptor.Name);
Best regards,
Haneef
JH
John H
May 31, 2007 05:57 PM UTC
Hi Haneef,
That doesn't work for me. The table name is always the top level, it is never any of the nested tables within it.
Any ideas?
Thanks
John
HA
haneefm
Syncfusion Team
May 31, 2007 06:53 PM UTC
Hi John,
Please try these code to get the nested table name.
void TableControl_MouseMove(object sender, MouseEventArgs e)
{
Point pt = new Point(e.X, e.Y);
GridTableControl tControl = sender as GridTableControl;
Element el = tControl.PointToNestedDisplayElement(pt);
string tName = el.ParentTableDescriptor.Name;
CurrencyManager cm = this.gridGroupingControl1.GetTable(tName).GetCurrencyManager();
DataView dv = cm.List as DataView;
if (dv != null)
{
Console.WriteLine(dv.Table.TableName + ":::" + tName);
}
}
Best regards,
Haneef