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

[Solved] Custom command button to expand row

1 Answer 134 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.
MICHAEL
Top achievements
Rank 1
MICHAEL asked on 14 Jun 2012, 08:12 PM
Hello,

Can someone please help me add make a custom command button expand the row.  I want the custom command button to act just like the + sign on the grid.  The reason why I want the command button it because this detail row is 3 levels deep and the user may not see another expand, but they will see the custom button.

Here is my command button.  How do i expand the the row?  Also, how do I add a tool tip for my button?  Thanks!!


columns.Command(commands =>
{
    commands.Custom("payments") 
    .ButtonType(GridButtonType.Image)
    .HtmlAttributes(new { id = "payments" }) 
    .Ajax(true)
}).Width(100);

1 Answer, 1 is accepted

Sort by
0
Chris Neave
Top achievements
Rank 1
answered on 15 Jun 2012, 01:12 PM
You should be able to get a tool tip just by adding a "title" attribute, like this:
columns.Command(commands =>
{
    commands.Custom("payments") 
    .ButtonType(GridButtonType.Image)
    .HtmlAttributes(new { id = "payments", title = "Your tooltip text" }) 
    .Ajax(true)
}).Width(100);

To expand the row you'll have to add a click handler and use the grid expandRow function:
http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-client-api-and-events.html#expandRow
Tags
Grid
Asked by
MICHAEL
Top achievements
Rank 1
Answers by
Chris Neave
Top achievements
Rank 1
Share this question
or