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: Move highlighted Record with mouse

Thread ID:

Created:

Updated:

Platform:

Replies:

59522 Apr 16,2007 03:43 PM UTC Apr 16,2007 04:03 PM UTC WinForms 1
loading
Tags: GridControl
Falk Neumann
Asked On April 16, 2007 03:43 PM UTC

Hi!

When I move the mouse over a GGC, I want to move the currently highlighted RecordRow with it. How can this be managed? Is there a property that solves this problem? Or do I need to manage the Highlighting manually?


Regards
Falk

haneefm [Syncfusion]
Replied On April 16, 2007 04:03 PM UTC

Hi Falk,

One way you can do this by turn ON the record based selection technique and then handle the MouseMove event of the GridTableControl to add/remove the mouse moveover record using the Table.SelectedRecords property. Here is a code snippet to show this.

//Turn ON Record - based selection.
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
//Turn OFF Cell - based selection.
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None;


this.gridGroupingControl1.TableControl.MouseMove +=new MouseEventHandler(TableControl_MouseMove);

Record LastRec = null;
private void TableControl_MouseMove(object sender, MouseEventArgs e)
{
GridTableControl tc = sender as GridTableControl;
Point pt = new Point(e.X,e.Y);
Element el = tc.PointToNestedDisplayElement(pt);
if( el.Kind == DisplayElementKind.Record)
{
Record rec = el.GetRecord();
if( LastRec != null )
tc.Table.SelectedRecords.Remove(LastRec);
if( rec != null )
{
tc.Table.SelectedRecords.Add(rec);
LastRec = rec;
}
}
}

Sample : GGCMouseMove.zip

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

;