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

Reordering columns in a databound GridListControl

I got a GridList for wich I set the datasource to an arraylist. My question is how can I set the order in wich the columns containing the properties of my custom class are displayed in the gridlist? Something like public class whatEver private strname as string = "Name" private strlastname as string = "Lastname" public property name as string get name=strname end get end property public property lastname as string get lastname=strlastname end get end property end class public class withTheGrid public sub aSub() dim a as new arraylist grdList.beginupdate grdList.dataSource = a a.add(new whatever) a.add(new whatever) grdList.endupdate end sub end class Now I got the info right, but let''s say it prints the name then the lastname, how do I get it to do the opposite.

1 Reply

AD Administrator Syncfusion Team March 22, 2005 01:40 PM

You can control the display order of the properties in your ArrayList objects by having your ArrayList implement ITypedList. Here is a forum thread that has sample code. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=9194 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.

Loader.
Live Chat Icon For mobile
Up arrow icon