Patrick Desjardins Blog
Patrick Desjardins picture from a conference

Telerik MVC grid can insert new rows at the bottom of the grid since 2012 sp1

Posted on: 2012-05-02

It's rare that I am writing about third party control but Telerik grid has a new feature that is kinda hard to find any way to implement. If you want to insert a new row to a Telerik ASP.Net MVC grid that you need to add a call to the method InsertRowPosition. This can be done inside the method Editable of the grid.

 @Html.Telerik().Grid<YourObjectType>().Editable(e=>e.InsertRowPosition(GridInsertRowPosition.Bottom)) 

This is a short snippet of code to demonstrate how to add a row at the bottom of a grid with Telerik Grid.

Of course, to the button to add a new row you need to use the ToolBar method to add a command to insert. This is done by adding ToolBar method to the Telerik().Grid().

 .ToolBar(c=> c.Insert().ButtonType(GridButtonType.Text))