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.

TableDescriptor columns order

Thread ID:





46552 Jul 14,2006 03:03 PM Jul 17,2006 08:19 PM Windows Forms 3
Tags: Grouping
Irina Jouk
Asked On July 14, 2006 03:03 PM

Hi, How the columns order is assigned in TableDescriptor?. The Datasource of my Grouping control is a struct. Just after datasource was set, the TableDescriptor has different columns order (which defines display order)then struct had. So how could I control columns order?

Administrator [Syncfusion]
Replied On July 17, 2006 03:02 AM

Hi Irina, Refer to the KnowledgeBase(KB) article link below, that helps in doing this. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=159 Thanks for using Syncfusion Products. Regards, Rajagopal

Irina Jouk
Replied On July 17, 2006 01:09 PM

Hi Rajagopal, In TableDescriptor by default I have col#3 ''Memo'' and col#6 ''Hours'' When I try to change the order of both columns to display first ''Hours'' and then ''Memo'' by using tableDescriptor.Columns[3].Name="Hours" I get an error {"Item has already been added. Key in dictionary: \"Hours\" Key being added: \"Hours\"" } When I use tableDescriptor.VisibleColumns[3].Name="Hours", it works, but when later in TableModel_SaveCellFormattedText event I use grpctrlActivityList.TableDescriptor.NameToField("Hours") it returns original col index (i.e. #6). Looks like VisibleColumns order is changed but not Columns order. What can I do with that? Thanks

Administrator [Syncfusion]
Replied On July 17, 2006 08:19 PM

If you want to move columns in the Columns collection, then try using TableDescriptor.Columns.Move. //move "Col2" to position 2 in the Columns collection int col4 = gridGroupingControl1.TableDescriptor.Columns.IndexOf("Col4"); gridGroupingControl1.TableDescriptor.Columns.Move(col4, 2); Or, you can use gridGroupingControl1.TableDescriptor.Columns.Remove to remove an existing and then use gridGroupingControl1.TableDescriptor.Columns.Insert to insert it somewhere else in the collection.


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.