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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get a column's index in a MouseUp event, not a MouseDown ()

Thread ID:




12886 Apr 14,2004 12:34 PM UTC WinForms 0
Tags: FAQ
Administrator [Syncfusion]
Asked On April 14, 2004 12:34 PM UTC

Hello all, I have a winform with two DataGrid, my goal is to drag a column's name of the first DataGrid and drop it in a cell of the second DataGrid. To do that I use HitTestInfo: System.Windows.Forms.DataGrid.HitTestInfo myHitTest; myHitTest = dataGrid1.HitTest(e.X,e.Y); int p=myHitTest.Column; When I click on the first datagrid, this code run and give me the column's index (p), the problem is when I drop it in the second DataGrid, I'd like to know the target column's index. With the same code p=-1, I think because the HitTestInfo member return a value on a MouseDown and not on a MouseUp. If anyone can tell me how to do it, it would be very great P.S: I saw the FAQ solution "How can I get text from a column header in a MouseUp event" . http://www.syncfusion.com/faq/winforms/search/696.asp but it doesn't run, so tell me if I have to try again with this code. Thanks for your help


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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