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
close icon

Binding to arraylist and order of the columns

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

1 Reply

AD Administrator Syncfusion Team December 17, 2004 10:18 PM UTC

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.)http://64.78.18.34/Support/Forums/message.aspx?MessageID=9194

Loader.
Live Chat Icon For mobile
Up arrow icon