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
975
Set Column Display Order at runtime
posted

Hi,

I have Ultra Grid in windows application. I want to change column display order at runtime.

I'm wondering if there is a way to change the display order of column. Please help me ASAP

 

Parents
  • 469350
    Verified Answer
    Offline posted

    Yes, use the InitializeLayout event and set the column.Header.VisiblePosition on each column. Note that you must set the columns in order so as to prevent the positoin of one column from interfering with another.

     

    So this is correct: 

        e.Layout.Bands[0].Columns["My First Column"].Header.VisiblePosition = 0;

        e.Layout.Bands[0].Columns["My Second Column"].Header.VisiblePosition = 1;

        e.Layout.Bands[0].Columns["My Third Column"].Header.VisiblePosition = 2;

     

    This would be wrong:

        e.Layout.Bands[0].Columns["My First Column"].Header.VisiblePosition = 2;

        e.Layout.Bands[0].Columns["My Second Column"].Header.VisiblePosition = 0;

        e.Layout.Bands[0].Columns["My Third Column"].Header.VisiblePosition = 1;

     

Reply Children
No Data