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
410
Add row at top in UltraGrid
posted

I want to add a new row in ultra grid at index 0 mean at top of grid.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    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.

Children