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
245
convert wingrid to list
posted

Hi,

I am currently working on wingrid. In that.. after the data getting displayed in the wingrid, i want to take all the rows from the grid to new list including the column header.

In windows datagrid we will take the column header like this.

List<ColumnHeader> cols = new List<ColumnHeader>();
       
// populate
       
foreach (ColumnHeader column in Datagrid.Columns) {
            cols
.Add(column);
       
}

but in wingrid there is no class called columnHeader...

Kindly tell me how to take the columns name as well as the rows from the grid to the new list..

Regards,

Ram N

  • 469350
    Suggested Answer
    Offline posted

    Hi Ram,

    In the WinGRid, the code would look something like this:

    foreach (UltraGridColumn column in grid.Bands[0].Columns)

    {

         cols.Add(column.Header);

    }

  • 2426
    posted

    Hello Ramvrp,

    You can loop through the collection of columns to get the information that you need. You can then get the ColumnHeader object from the Column's Header property.