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
160
How to set column index (position) in xamwebgrid
posted

Hi All,

I am using XamWebGrid 10.1 control. I want to set the column position after data is bind to grid using code.

Parents
No Data
Reply
  • 6912
    Verified Answer
    posted

    Hi,

    You can rearrange the columns by changing their order in the XamWebGrid.Columns collection.

    This is just a simple snippet that demonstrates setting the column with key = "Column1" as first column:

    var column = this.xwGrid.Columns.DataColumns["Column1"];
    this.xwGrid.Columns.Remove(column);
    this.xwGrid.Columns.Insert(0, column);

    where xwGird is a reference to XamWebGrid object

    I hope that this will help you

Children