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
495
Sorting of columns server-side
posted

Is there a way to change the order that columns in a webdatagrid are displayed?  These columns are automatically generated from a databind.  The order of the columns is configurable by user, so it can't be hard-coded in any fashion.  Columns used with the old UltraWebGrid had a "move" method to accomplish this.  Is there a similar technique for a WebDataGrid's gridfield?  I've tried iterating across each column, setting the VisibleIndex property of each colum with the appropriate index, but this produced unexpected results (it seems as though the VisibleIndex for one column would change as I updated another).  Any help with this would be appreciated

Parents
No Data
Reply
  • 14049
    Offline posted
    The VisibleIndex property is the way to go here.
    The other columns indices are adjusted according to the new index of the
    column you're trying to move.
Children
No Data