Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Using a manually defined schema to control column ordering when binding to an IList
posted

I have an architecture that returns lists of objects via an IList interface (or IList<type> when using generics).  I can easily bind this to an ultrawingrid but i don't seem to have any control over the ordering that the columns are displayed.

I'm calling SetDataBinding( <IList data>, null, true) have manualy defined a schema with only the columns i want to show but it's not taking the ordering that i assigned when i created in the designer dialog.

Is there a way i can specifically order the columns that are displayed when using an IList<> as the datasource?

 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    Is it honoring the hidden columns, but not the order? If that's the case, then something is wrong. 

    If it's not honoring either the hidden columns or the column order, then my guess is that the name of the band you defined in the schema is not the same as the name of the band in the actual data. You might want to just run the app and display the grid.DisplayLayout.Bands[0].Key to see what the root band key is, then make sure you use the same key at design-time when you define the schema. 

    Another option would be to handle the InitializeLayout event. In this event, you can set teh position of each column using the e.Layout.Bands[0].Columns[column key].Header.VisiblePosition of each column. 

Reply Children
No Data