Hi,
The grid always shows new rows at the end because of the way the BindingManager notifications work. There's no way to insert a row via the grid. But what you could do is add a new row and then move that row to the position you want. Something like this:
UltraGridRow row = this.ultraGrid1.DisplayLayout.Bands[0].AddNew(); row.ParentCollection.Move(row, 0); this.ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(row);
thx Mike, but i ask about the ultragrid with multi clomns header like this:
You are getting this error for Band 0? I don't see how that could possible be. The exception message you have here indicates that the grid doesn't know which child island to add the row to for a child band. This will never occur for the root band (Band 0).
If you are trying to add a child row, then you must first activate the parent row under which you want that row to be placed.
I have an UltraGrid with multi column header when i tried to add new row:
UltraGridRow row = this.ultraGrid1.DisplayLayout.Bands[0].AddNew(); row.ParentCollection.Move(row, 0); this.ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(row);this error occured:Not enough context to add a new row. Either a row in this band or the parent band has to be active to provide for enough context
I don't understand. What do column headers have to do with inserting a row?