We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GGC and MouseMove, what table and row is the mouse over?

Thread ID:

Created:

Updated:

Platform:

Replies:

61709 May 31,2007 09:56 AM UTC May 31,2007 06:53 PM UTC WinForms 3
loading
Tags: GridControl
John H
Asked On May 31, 2007 09:56 AM UTC

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

haneefm [Syncfusion]
Replied On 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

John H
Replied On 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

haneefm [Syncfusion]
Replied On 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

CONFIRMATION

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;