Adding new row to top of grid

5 posts, 0 answers
  1. Jason
    Jason avatar
    3 posts
    Member since:
    Dec 2013

    Posted 13 May Link to this post

    Is it possible to add a new row to edit to the top of the grid instead of the bottom? I was able to sort after adding the new item to get the last added item to display at the top, but I want to be able to have the new row be at the top immediately after clicking to add the new row while editing.The image attached shows how the GridView works now, but I want to be able to have the new row to be at the top of the grid while editing. Any help would be appreciated.
  2. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 17 May Link to this post

    Hi Jason,

    You should be able to achieve this with the built-in mechanism of RadGridView, through its NewRowPosition property. You can take a look at the Adding Rows article for more information on the matter.

    Additionally, you may also find the Adding New Entries topic useful.

    Best Regards,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jason
    Jason avatar
    3 posts
    Member since:
    Dec 2013

    Posted 17 May in reply to Stefan X1 Link to this post

    That would also put the "Click here to add new item" bar in the grid, which is not wanted.The BeginInsert adds a new row to edit, but it's always at the bottom of the grid. I want that row to be on the top while editing. 
  5. Jason
    Jason avatar
    3 posts
    Member since:
    Dec 2013

    Posted 17 May Link to this post

    I use the NewRowPosition position property currently with a value of "None" to keep from showing the ""Click here to add new item" bar.
  6. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 20 May Link to this post

    Hello Jason,

    Thanks for clarifying this.

    Such requirement can be achieved by modifying the template of RadGridView and changing the position of the GridViewNewRow element. Please check out the Add new row on top of the radgridview and popup forum thread for more information and a runnable sample project.

    Hope this helps.

    All the best,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready