Option to change button type (like in Telerik MVC)
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);
commands.Delete().ButtonType(GridButtonType.Image);
})
19 comments
Robert
Posted on:12 Jun 2015 16:22
If you can change the button type in the JavaScript, you should be able to change it in the MVC helpers. There should be a direct 1-1 mapping between JS features and MVC features.
Levi
Posted on:10 Jul 2014 19:44
>Does this seem like an applicable solution for you?
No. Too much code and boilerplate for something that should be in the box.
Also, a pure JavaScript approach allows the className parameter, but the MVC wrappers do not. The MVC wrappers also ignore adding a class via the HtmlAttributes. This makes it cumbersome to further integrate Bootstrap styles.
William John Adam
Posted on:12 Dec 2013 11:45
>Does this seem like an applicable solution for you?
No.
David
Posted on:25 Oct 2013 19:06
I agree, Telerik has this option in each and every other control. They removed it from this control apparently. :(
Vince
Posted on:02 May 2013 17:47
I definitely cast my vote for this, I can't seem to understand why you would remove existing functionality.
Jeff
Posted on:26 Feb 2013 21:49
This is not a satisifactory solution. I can't imagine it would be that difficult to add this functionality to the Kendo Grid. Yes there are messy work-arounds for the standard buttons but I have not found a solution for custom buttons.
Sean Cross
Posted on:18 Feb 2013 01:55
FWIW, I made my buttons image only with the following css
.abutton,
div.k-grid .k-grid-edit,
div.k-grid .k-grid-delete,
div.k-grid .k-grid-cancel,
div.k-grid .k-grid-update {
display:inline-block;
width:16px;
height:16px;
text-align:center;
text-indent:-444px;
min-width:0;
border:0;
padding: 0;
}
div.k-grid .k-grid-edit {
background: url('/Content/images/TEdit.png');
}
div.k-grid .k-grid-delete {
background: url('/Content/images/TDelete.png');
}
div.k-grid .k-grid-cancel {
background: url('/Content/images/TDelete.png');
}
div.k-grid .k-grid-update {
background: url('/Content/images/TUpdate.png');
}
Sean Cross
Posted on:18 Feb 2013 01:54
No, Brandon's solution is not an applicable solution, it;s a patronising solution.
Kendo is missing a large amount of functionality from the old extensions and the Telerik response is always "write more code". I pay you guys to write the code. If I had known how much stuff was missing from the kendo controls I would gone to one of your competitors.
ADMIN
Brandon
Posted on:15 Feb 2013 18:13
Guys, the current option you have is to utilize column templates to define different button types for grid commands. You can review this code library project for reference:
http://www.kendoui.com/code-library/mvc/grid/different-button-types-for-grid-commands.aspx
Does this seem like an applicable solution for you?
Imported User
Posted on:04 Jan 2013 13:48
While the posted workaround by Kenshin works, there is a significant amount more of code needed on a per-grid basis in order to use links (text only) instead of the buttons. Although this solution *will* work, what used to take one line of code with the Telerik MVC grid now takes more than a dozen!
Brian
Posted on:21 Dec 2012 21:41
Yeah, that works for me. Thanks!
Imported User
Posted on:21 Dec 2012 15:26
Hi,
I solved it with this css:
<style type="text/css">
.k-grid table tr td .k-button {
padding: 0 3px;
}
.k-button.button-icononly {
min-width: 25px !important;
text-indent: -9999px;
}
.k-button.button-icononly .k-icon {
float: left;
margin: 1px 0 0;
}
</style>
Then in Html.Kendo().Grid()
.Columns(columns =>
{
columns.Command(commands =>
{
commands.Custom("Edit").Action("Edit", "Product").HtmlAttributes(new { @class = "k-grid-edit button-icononly" }).Text("<span class=\"k-icon k-edit\"></span>Edit");
});
})
This way, the buttons looks equal with or without text.
Alastair
Posted on:09 Nov 2012 12:24
One of the shortcomings of the Telerik grid which would be great to be resolved if this feature is supported is to also allow more configuration over the popup editing window. e.g. I may want small buttons on the grid (image only) and image and text within the popup dialog. If this is difficult then the grid button style should not be inherited by the popup. (i.e. it should always be image and text)
John
Posted on:29 Oct 2012 15:05
Absolutely necessary for migrating our products from the existing grids to kendo
Imported User
Posted on:25 Oct 2012 18:57
+1
Douglas
Posted on:15 Oct 2012 05:04
+1
Jun
Posted on:24 Sep 2012 19:15
please we need this like when using Telerik extensions
Bradley Fulton
Posted on:22 Sep 2012 19:50
I need this option! My website in Telerik MVC Extensions currently resets all of the buttons to be image only when accessed from a mobile device, and it works very well. Forcing the text into all the buttons makes the screens much harder to use on a phone.
Sam
Posted on:20 Sep 2012 18:00
yes pls. there should be an option for this in the Kendo UI like the Telerik extensions for ASP.NET MVC. People may not want to see the text "Delete" , "Edit". they may just want to see the image representation for it with a tooltip upon hover that says "Delete", "Edit" . Very surprised that this was not built into the Kendo UI.