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

Grid button client template - change width

2 Answers 690 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 22 Jun 2017, 12:28 PM

Trying without success to alter the width of the button rendered in a grid using client template -

columns.Template(c => { }).ClientTemplate("<a class='k-button k-button-icontext k-grid-ManageCompany' href='" + Url.Action("ManageCompanies") + "/#= CompanyId #'" + ">#= Name #</a>").HtmlAttributes(new { @class = "customGridRowStyle", title = "Edit Company Profile" }).Width(50); //.Filterable(filterable => filterable.UI("nameFilter"));

 

When rendered, the code is as follows -

<td class="customGridRowStyle" title="Edit Company Profile" role="gridcell"><a class="k-button k-button-icontext k-grid-ManageCompany" href="/Portal/Search/ManageCompanies/344"><span class="k-icon k-i-edit"></span></a></td>

 

Min-width seems to be defined as :

k-grid tbody .k-button, .k-ie8 .k-grid tbody button.k-button {
min-width: 64px;
}

I've tried seeting the style within the page itself as -

.k-button .k-button-icontext .k-grid-ManageCompany {
            min-width: 30px;
            width: 30px;
        }

 

But it seems to have no effect.

Ive also tried adding the style to the HtmlAttributes with no success either.

Any help appreciated.

Terry.
.

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 23 Jun 2017, 12:29 PM
Hi Terry,

As a workaround you can set the styles of the Kendo button inline in the template. 

I have assembled a small project (resize-button.zip) that illustrates how to change the min-width of the Kendo button using inline styles.

Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Terry
Top achievements
Rank 1
answered on 23 Jun 2017, 01:03 PM

Thank you very much, simple and easy. Never occured to me to try that!

Tags
Grid
Asked by
Terry
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Terry
Top achievements
Rank 1
Share this question
or