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

[Solved] Grid Toolbar: Mixing Template and Edit buttons

7 Answers 281 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.
nachid
Top achievements
Rank 1
nachid asked on 17 Feb 2011, 01:27 PM
I am trying to mix a toolbar template and an Insert button
Here is the code
Html.Telerik().Grid()
    .ToolBar(toolBar => { toolBar.Insert().ButtonType(GridButtonType.ImageAndText);
                    toolBar.Template(() =>  {%>
                                       <div>this is another text place</div>
                                       <%} );
                }
            )

However, the template overrides everything and my Insert button is never rendered
Is this by design?
If so, what's the way to have my insert button included in my template
Thank you for your help

7 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 18 Feb 2011, 08:26 AM
Hello nachid,

 Yes, this is by design. The toolbar template sets the html for the whole toolbar. You can try rendering the markup for the insert button inside the template definition. This markup depends on the button type of the command and you can check it by inspecting the source of the server editing example.

Regards,
Atanas Korchev
the Telerik team
0
nachid
Top achievements
Rank 1
answered on 18 Feb 2011, 12:20 PM
Thanks Atanas,
That exactly what I thought doing
I was not sure that the editing form will be rendered anyway.
I will give a try as soon as possible and let you know.

Thank you again
0
nachid
Top achievements
Rank 1
answered on 18 Feb 2011, 12:35 PM
Worked like a charm
Thanks again
0
Deepthi
Top achievements
Rank 1
answered on 27 Jun 2011, 06:08 PM
Can anybody post the code for adding the markup for insert inside the template definition of tool bar please

I would like to add 3 buttons viz., add, edit and delete to the toolbar. I have added the Html buttons(input tag) to the toolbar using templates. Now i would like to add functions to the click events of these.

When a row is selected and edit button is pressed i want the user to be able to edit the row. Is this possible can we simulate command.edit function using the row.select and having an edit button in the toolbar?


0
venky
Top achievements
Rank 1
answered on 04 Aug 2011, 04:04 PM
I am also looking to add buttons to insert/edit/delete buttons in the toolbar and hook them to the corresponding grid events.
Is is something trivial to do?
Thanks in Advance.
Venky
0
Srinivasa
Top achievements
Rank 1
answered on 19 Aug 2011, 08:44 PM
Hello nachid,

could you post the code for both template and add buttons.

Thanks
0
Carl
Top achievements
Rank 1
answered on 26 Aug 2011, 03:57 PM
Tags
Grid
Asked by
nachid
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
nachid
Top achievements
Rank 1
Deepthi
Top achievements
Rank 1
venky
Top achievements
Rank 1
Srinivasa
Top achievements
Rank 1
Carl
Top achievements
Rank 1
Share this question
or