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.

Drag and drop column in a virtual grid

Thread ID:





15303 Jun 15,2004 09:44 PM Jun 16,2004 02:20 AM Windows Forms 1
Tags: GridControl
Yin San Phoon
Asked On June 15, 2004 09:44 PM

Is there a way to drag and drop column in a virtual grid?

Administrator [Syncfusion]
Replied On June 16, 2004 02:20 AM

To manage this, you need to maintain a correspondence between the initial col positions and any moved col positions. You could do this in several ways, One would be to add an array of ints that you initialize 1 through the number of columns. Then when a column is moved, you move this elements of this int array. Also, anytime you access your external datasource, you use this index array to manage the proper correspondance. That''s the idea. Another way you could do this is to add a hidden row at the top of the grid that you use as this index array, and you initialize it to start as 1 to number of columns. The advantage is that the the grid itself will take care of moving these values. Here is the modified VirtGrid tutorial that uses this technique. It adds (and hides) a row at the top of the grid, The SaveCellInfo and QueryCellInfo have been modified to use this row value as col index into the external data source.


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.