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

Drag Drop Cell location

Thread ID:

Created:

Updated:

Platform:

Replies:

25825 Mar 8,2005 02:10 PM UTC Mar 9,2005 08:42 PM UTC WinForms 2
loading
Tags: Grouping
Webfrog
Asked On March 8, 2005 02:10 PM UTC

Hi, I would like to be able to drag and drog several rows from one grouping grid onto another one. Nevertheless I want to be able to allow the drop only when the mouse goes over a parent row in the destination grid. I am using the code below to find out the current location based on the cursor position: [c#] // Convert the screen coordinates into the grid coordinates System.Drawing.Point ptGrid = gridMain.PointToClient(new System.Drawing.Point(e.X,e.Y)); // Get the row and column from that point int RowIndex, ColIndex; gridMain.TableControl.PointToRowCol(ptGrid,out RowIndex, out ColIndex); I have noticed a strange behaviour with the values returned by the PointToRowCol funstion: The column index returned is always that of the parent table column, even when the mouse is currently on a child table record. I would have expected it to return me the column index of the child record when the pointer is over a child row... Also, I have not found a way yet to get a handle on the actual record corresponding to the RowIndex (bearing in mind that this record can be a parent record or a child record). Hope you can help.

Administrator [Syncfusion]
Replied On March 9, 2005 05:33 PM UTC

Hi, I uploaded a modified HierarchySample. See HierarchySampleWithHitTest.zip It contains sample code that listens for MouseMove events and then calls a helper method to determine the display element and the column under the cursor and dumps the info to the output window. PointToRowCol itsself does not work for nested tables because the nested tables are actually just a big covered range within the parent table control. Stefan

Administrator [Syncfusion]
Replied On March 9, 2005 08:42 PM UTC

Just fyi. For the next release we also added some helper routines that will make this easier. You can then simply call private void TableControl_MouseMove(object sender, MouseEventArgs e) { Point ptClient = new Point(e.X, e.Y); GridTableControl tableControl = this.groupingGrid1.TableControl; GridTableCellStyleInfo style = tableControl.PointToTableCellStyle(ptClient); Element displayElement = style.TableCellIdentity.DisplayElement; } Stefan >Hi, > >I uploaded a modified HierarchySample. See >HierarchySampleWithHitTest.zip > >It contains sample code that listens for MouseMove events and then calls a helper method to determine the display element and the column under the cursor and dumps the info to the output window. > >PointToRowCol itsself does not work for nested tables because the nested tables are actually just a big covered range within the parent table control. > >Stefan >

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

;