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.
Unfortunately, activation email could not send to your email. Please try again.

Getting a cell''s boundaries (rectangle)

Thread ID:

Created:

Updated:

Platform:

Replies:

18173 Aug 25,2004 07:29 AM Aug 25,2004 02:15 PM Windows Forms 3
loading
Tags: GridControl
Doug Lind
Asked On August 25, 2004 07:29 AM

Hi, I am using OLE D&D to implement row dragging within a GDBG and would like to emulate the drop target indicator, used on a default row/column drag. My intent is to draw the drop target indicator from the MouseMove event. Is there a way to get a cells boundaries, relative to the grid? Are there any hooks in the cell model I can use? I''ve tried the example referred to in the Windows FAQ but the point at which the event triggers varies with mouse speed so I end up with drop targets in the middle of a cell. Thanks, Doug

Administrator [Syncfusion]
Replied On August 25, 2004 08:21 AM

If you are in the grid''s mousedown event, I think you can use code like this to get the cell rectangle.
int row, col;
Point pt = new Point(e.X, e.Y);
if(this.gridDataBoundGrid1.PointToRowCol(pt, out row, out col, -1))
{
	Rectangle cellRect = this.gridDataBoundGrid1.RangeInfoToRectangle(GridRangeInfo.Cell(row, col));
}

Doug Lind
Replied On August 25, 2004 02:05 PM

Thanks that worked great! Now that I can paint a line on the cell, how do I remove it. It seems like a refresh, refreshRange or invalidate would work but it does not occur. It may be that I am firing the refresh event from within a mousemove event, with a mouse button down (i.e. dragging). The code executes the call but nothing happens until the button is released. Is there a way to force the cell to repaint itself? Would being in drag mode have anything to do with it? Doug

Administrator [Syncfusion]
Replied On August 25, 2004 02:15 PM

Here is a forum thread that shows a minimal sample to drawing feedback as you drag. Maybe that will give you some ideas. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=10611 Here is another forum thread that has a sample using a DragHelper class in our library code. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=3815

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.

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.

;