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.

Change column order in gridlist

Thread ID:

Created:

Updated:

Platform:

Replies:

11035 Feb 20,2004 12:38 PM Feb 23,2004 03:11 PM Windows Forms 5
loading
Tags: GridControl
Greg Shomette
Asked On February 20, 2004 12:38 PM

I am using a pair of Syncfusion GridListControls matched with their own Syncfusion ComboBoxBase. They are both based on the same data table. Users can choose by name in one and item number in the other. I''d like name to be first column in one and the number the first column in the other. I also want to see the number in the second column after the name and the name in the second column after the number. So hiding columns won''t solve the requirement. Is there a way to change the order or mapping of the columns in a GridListControl without using separate queries? Thanks!

Administrator [Syncfusion]
Replied On February 20, 2004 03:59 PM

You would have to handle the embedded gridcontrol''s QueryCellInfo on one of your gridlistcontrols to swap the column order. Here is a sample. forum11035_1080.zip

Greg Shomette
Replied On February 23, 2004 09:16 AM

Thanks for your response. This doesn''t work in our case because both of our GridListControls have the same ValueMember. We hide that column from view. We also want the two to be connected so that when one is changed the other changes to the same record. That works now because they are both bound to the same datatable. But the order of the columns is the same in both lists. Is there a way to change the order of the columns without changing the ValueMember? Thank-you.

Administrator [Syncfusion]
Replied On February 23, 2004 09:53 AM

Using QueryCellInfo to reorder columns in a GridListControl does not rely on any particular id column. Here is the sample modified to have an hidden id column plus 2 extra columns with the the two dropdowns showing only the 2 extra columns swapped. If you want both comoboxes to remain in sync (change in one, changes the other), then you have to make sure the two gridlistcontrols use the same bindingcontext. forum11035_9003.zip

Greg Shomette
Replied On February 23, 2004 02:32 PM

Thanks, Clay. I should have picked that up from the first example. I''m still having problems, though. I''m using VB.Net and maybe I''m not translating it properly from C#. I am using a gridlistcontrol as you do in your example, but I can''t find a querycellinfo event or property. We are using version 2 Thanks.

Administrator [Syncfusion]
Replied On February 23, 2004 03:11 PM

QueryCellInfo is an event in GridListControl.Grid (not in GridListControl). Here is a VB project. forum11035_VB_46.zip

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.

;