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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DragDrop GridData

Thread ID:





6479 Aug 13,2003 09:04 PM UTC Aug 14,2003 05:18 AM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On August 13, 2003 09:04 PM UTC

I am trying to allow the user to drag multiple cells off the grid and display the results in another control. I have been able to get the GridData object from the DragEventArgs variable. gd = (Syncfusion.Windows.Forms.Grid.GridData)e.Data.GetData(typeof(Syncfusion.Windows.Forms.Grid.GridData)); But I'm not sure how to get the cell contents from the GridData object itself. The following always returns false. gd.Contains(1, 1); What I really want is the original position of the dragged cells (e.g. "B2", "C3", etc). Is there any sample code out there that shows how to do this?

Administrator [Syncfusion]
Replied On August 13, 2003 10:27 PM UTC

Attached is a sample that drags a GridData object to a TextBox. There is no cell information included in the GridData object, so if you want that information, you can add another dataobject to the ole dataobject that is part of the drag. The sample does this by adding a point object that contains the top-left cell indexes of the source data.

Administrator [Syncfusion]
Replied On August 13, 2003 11:48 PM UTC

Wow, thanks! Looks like I was missing this step: GridStyleInfo style = new GridStyleInfo(data[row, col]); Just to confirm, the GridData object does not return multiple selection ranges, correct? (RowCount or ColCount will only be greater than 1 if an entire row/column is selected.) If I need to support multiple cell selections I should just create my own list object in QueryOleDataSourceData, right?

Administrator [Syncfusion]
Replied On August 14, 2003 05:18 AM UTC

The default implementation only drags the active range. You could handle mulitple ranges by handling the QueryOleDataSourceData and placing a GridRangeInfoList in the ole dataobject (like the sample did with a Point object). Your drop target would have to handle the GridRangeInfoList data.


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon