Grid button client template - change width

3 posts, 1 answers
  1. Terry
    Terry avatar
    20 posts
    Member since:
    May 2017

    Posted 22 Jun Link to this post

    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. Answer
    Georgi
    Admin
    Georgi avatar
    170 posts

    Posted 23 Jun Link to this post

    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.
  3. Terry
    Terry avatar
    20 posts
    Member since:
    May 2017

    Posted 23 Jun in reply to Georgi Link to this post

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

Back to Top