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
1510
how to set column-order inside InitializeLayout ?
posted

Hi ...

I've worked with the Windows FORMS edition of the Infragistics controls ...

how would I do this in the UltraWEBgrid InitializeLayout ?

 

 

e.Layout.Bands[0].Columns["EmployeeName"].Header.VisiblePosition = 1;
e.Layout.Bands[0].Columns["Availability"].Header.VisiblePosition = 2;
e.Layout.Bands[0].Columns["MaxWorkHoursForEmployee"].Header.VisiblePosition = 3;
e.Layout.Bands[0].Columns["ProjectCountForEmployee"].Header.VisiblePosition = 4;

Please help,

Thanx,
EE

Parents
No Data
Reply
  • 45049
    Suggested Answer
    posted

    EE,

    Use the Move() method of the WebGrid column object.  That will move its position within the Columns collection that contains it, without affecting your data source.

    Here's code for WebGrid that will work similarly to the WinGrid code you posted:

    e.Layout.Bands[0].Columns.FromKey("EmployeeName").Move(1);
    e.Layout.Bands[0].Columns.FromKey("Availability").Move(2);
    e.Layout.Bands[0].Columns.FromKey("MaxWorkHoursForEmployee").Move(3);
    e.Layout.Bands[0].Columns.FromKey("ProjectCountForEmployee").Move(4);

Children