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

Custom Toolbar with Insert

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim
Top achievements
Rank 1
Tim asked on 26 Oct 2011, 12:21 AM
Can anyone tell me how add custom html to the toolbar with the 'Add new record' button retained?

I'm currently using
.ToolBar(commands => commands.Insert())
, and I don't want to get rid of this, but I want to add another link to the toolbar, which is just going to be a
@Html.ActionLink()
to another page.

I'm using Razor, Asp.Net MVC 3, .Net 4 - just can't find the right syntax going by the examples in the demo area - the Razor example hasn't been updated and the demo doesn't cover my specific usage requirements:

http://demos.telerik.com/aspnet-mvc/razor/grid/customtoolbar

Thanks

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 26 Oct 2011, 01:13 PM
Hi Tim,

 I just answered your support ticket on the same subject. For convenience I am pasting my reply below:
*****************************************************************
Basically, you can either have a custom command or a custom toolbar template with a custom buttons.
For example, since you need another button, you can implement it as a custom command:

.ToolBar(commands =>
{
    commands.Insert();
    commands.Custom().Text("Custom Button");
})

or if you decide to use custom template, you can simply put a custom HTML link with the following class:
class="t-button t-grid-add" (<a class="t-button t-grid-add">Add new record</a>) and it will automatically work as an Insert button and will look like the original one.
*****************************************************************

All the best,
Georgi Tunev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Gopal
Top achievements
Rank 1
answered on 23 Nov 2012, 07:23 AM
Hi Georgi Tunev ,
    I was facing the same issue and this help me out to resolve it.Thanks a lot.
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Gopal
Top achievements
Rank 1
Share this question
or