If i have a ultrawingrid with derived columns 9columns calculated from other columns), how do i get all the rows (with header row) in a datatable? Thanks
Yes, you just need to change the row loop.
You can use one of these:
The first one will get all of the data rows. The second will skip any rows that are hidden or filtered out.
foreach (UltraGridRow row in this.ultraGrid1.Rows.GetAllNonGroupByRows())foreach (UltraGridRow row in this.ultraGrid1.Rows.GetFilteredInNonGroupByRows())
I see. The code you gave to take data from the grid into datatable does not seem to work if there is groupby column..in this case only the groupby rows are added..Any way to make the code work for grids with groupby columns
Well... it's not possible to create a DataTable for a multi-band grid. You would need multiple tables and a DataSet. And then you would have to figure out how you want to deal with creating the Relationship. It would depend on the data - you would need some key fields to hook up the parent and child data. It's much more complex than just creating a single DataTable.
Thanks..If there is more than 1 band.Just trying to make the code more generic.
Thanks. Can you give sample code for that?