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
965
Add new row at the top of xamGrid
posted

Hi guys,

How can I place the new inserted row at the top and not after all the other rows? (I refer to the inserted row and not to the place where I can insert data for the new row).

Thanks,

Alin

Parents
No Data
Reply
  • 40030
    Suggested Answer
    Offline posted

    Hi Alin, 

    We don't currently offer that behavior by default with the AddNewRow feature. 

    However, you could handle the RowAdded and re-insert the row to be first. 

     void grid_RowAdded(object sender, RowEventArgs e)

            {

                if (e.Row.Index != 0)

                {

                    grid.Rows.Remove(e.Row);

                    grid.Rows.Insert(0, e.Row);

                }

     

            }

    -SteveZ

Children
No Data