This is a migrated thread and some comments may be shown as answers.

Adding new row to top of grid

4 Answers 372 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 13 May 2016, 01:47 PM
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.

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 May 2016, 08:25 AM
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.
0
Jason
Top achievements
Rank 1
answered on 17 May 2016, 02:13 PM
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. 
0
Jason
Top achievements
Rank 1
answered on 17 May 2016, 02:17 PM
I use the NewRowPosition position property currently with a value of "None" to keep from showing the ""Click here to add new item" bar.
0
Stefan
Telerik team
answered on 20 May 2016, 11:31 AM
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.
Tags
GridView
Asked by
Jason
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Jason
Top achievements
Rank 1
Share this question
or