I need to add row into ultragrid. How to do this? I found only grid.Rows.Band.AddNew method - but it is adding only to the top band
I'm looping all the rows in the Grid and trying to add one or more child rows to the current row when it is necessary. I do not want to create parent and child tables and set the relationship in the dataset. I would like to add child rows while looping. This way I can create multilevel Treeview. How do I accomplish this programmatically? Thanks.
Hi,
You cannot add rows to the grid without those rows (and bands) existing in the data source. There's no such thing as an unbound row or an unbound band.
I think your best option here would be to bind the grid to an UltraDataSource, rather than a DataSet. You still need to define the Bands and columns, but it will be easier to simply add child rows in a hierarchy rather than having to define the relationships in the DataSet.
Another option you might want to consider is using the UltraTree instead of the UltraGrid. The tree lacks certain functionality such as grouping and summaries, but if you want to manually populate the control and you don't need those features, the tree has the advantaged of not needing to be bound.