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

Changing ButtonType for Grid Commands

2 Answers 225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 14 Sep 2012, 06:40 AM
Good morning everyone,


I am currently using the licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012) and trying to figure out how to change the ButtonType for the Grid Commands.


Before this, I was using the licensed version of Telerik Extensions for ASP.NET MVC.  Below is the code I had for it:

@{Html.Telerik().Grid(Model)
    .Name("grdAllUsers")
    .DataKeys(keys => keys.Add(k =>
        k.Id)
    )
    .Columns(columns =>
    {
        columns.Bound(o => o.FirstName)
            .Width(150);
        columns.Bound(o => o.LastName)
            .Width(150);
        columns.Bound(o => o.EmailAddress)
            .Width(200);
 
        columns.Command(commands =>
        {
            commands.Edit().ButtonType(GridButtonType.Image);
            commands.Delete().ButtonType(GridButtonType.Image);
        })
        .Width(70)
        .HtmlAttributes(new { style = "text-align:center" });
    })
    .NoRecordsTemplate(@<text>No User records to display.</text>)
    .Pageable(paging =>
        paging.PageSize(15)
    )
    .Sortable()
    .Filterable()
    .Render();
}


The below is the current Kendo UI code:

@{Html.Kendo().Grid(Model)
    .Name("grdAllUsers")
    .Columns(columns =>
    {
        columns.Bound(o => o.FirstName)
            .Width(150);
        columns.Bound(o => o.LastName)
            .Width(150);
        columns.Bound(o => o.EmailAddress)
            .Width(200);
 
        columns.Command(commands =>
        {
            commands.Edit().ButtonType(???);
            commands.Delete().ButtonType(???);
        })
        .Width(70)
        .HtmlAttributes(new { style = "text-align:center" });
    })
 
    .Pageable(paging =>
        paging.PageSize(15)
    )
    .Sortable()
    .Filterable()
    .Render();
}

When I am using the "Edit" and "Delete" command for the Kendo UI Grid, I need to only use image button type.  How do i change it from ImageAndText (which seems to be the default), to Image button type only?  How can i make only the images show for these Grid command buttons like "delete", "edit", etc.  ??

Thank you very much for your help

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Sep 2012, 06:18 AM
Hello Sam,

I am afraid that this is not currently supported. The buttons can be only one type. 

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mario
Top achievements
Rank 1
answered on 20 Sep 2012, 07:19 AM
Please vote here:
vote
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Mario
Top achievements
Rank 1
Share this question
or