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.

Binding to arraylist and order of the columns

Thread ID:





22662 Dec 17,2004 12:14 PM Dec 17,2004 05:18 PM Windows Forms 1
Tags: GridControl
Cheunhui Wang
Asked On December 17, 2004 12:14 PM

Hi: I have an ArrayList i''d like to use as the data source. Each item in the array has six properties: public double DA{get{return _DA;} public double DB{get{return _DB;} ... public double DF{get{return _DF;} I bound the ArrayList to GridDataBoundGrid: (grid_SkewExpiry''s type is GridDataboundGrid, and OptionList is the ArrayList) this.grid_SkewExpiry.DataSource = OptionList; this.grid_SkewExpiry.Show(); after the grid is displayed, the column order turned out to be: DF,DE,DD,DB,DC,DA I''d like the columns display in order of DA,DB,DC,DD,DE,DF I figured I can call Model.Cols.MoveRange multiple times to sort this, but is there a better way to do this? and how does GridDataBoundGrid determine the order of the properties to display? Thanks, Chunhui

Administrator [Syncfusion]
Replied On December 17, 2004 05:18 PM

You can have your ArrayList implement ItypedList. In the GetItemsProperties, get the default property order using the techinque shown in this forum thread. But before returning the collection, reorder the colection to the order you prefer. (You may have to create a new collection and add the property descriptors in teh required order.)


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.