I want to add a new row in ultra grid at index 0 mean at top of grid.
thanks a lot for u r responce but i have a small doubt in this code in my system
UltraGridRow row = this.ultraGrid1.DisplayLayout.Bands[0].AddNew();
in the above for UltraGridRow it is saying missing any reference or UltraGridRow could not found may i know the reason pls. for this what i have to do
thanks
Hi,
Do you mean in code? Or do you want your users to be able to do this through the UI?
In code you can do something like this:
private void button1_Click(object sender, EventArgs e) { UltraGridRow row = this.ultraGrid1.DisplayLayout.Bands[0].AddNew(); row.ParentCollection.Move(row, 0); this.ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(row); }
To enable adding for your users, just grid.DisplayLayout.Override.AllowAddNew to one of the settings that includes the word "Top", like FixedAddRowOnTop.