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

How to set button width into telerik:GridTemplateColumn

1 Answer 320 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mina
Top achievements
Rank 1
Mina asked on 24 Apr 2013, 06:17 PM

Hello,

How to set width of the buttons inside the telerik:GridTemplateColumn column. I add 2 buttons to my grid

<telerik:GridTemplateColumn UniqueName="Export2">
    <ItemTemplate>
        <telerik:RadButton ID="btnExport2" runat="server" Text="Button2" CommandName="Export2" Width="100px" />
    </ItemTemplate>
    <ItemStyle HorizontalAlign="Center"/>
</telerik:GridTemplateColumn>
 
<telerik:GridTemplateColumn UniqueName="Export1">
    <ItemTemplate>
        <telerik:RadButton ID="btnExport1" runat="server" Text="Button1" CommandName="Export1" Width="100px" />
    </ItemTemplate>
    <ItemStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>

How to set buttons' width to fill all column's width? At that moment they does not fill all column's with. Take a alook at attached file.

Thank you.

1 Answer, 1 is accepted

Sort by
0
MasterChiefMasterChef
Top achievements
Rank 2
answered on 24 Apr 2013, 06:58 PM
Hi Mina,

If the RadGrid columns are static, then you should be able to just set the 'width' property of each button (currently you have both set to 100px). If the RadGrid is dynamic, you may want to set these columns to have a static width. You can do this by using the resizeColumn property (bottom of page here). Then you can just set both the column and button to have the same width. 

Hopefully this helps,
Master Chief
Tags
Grid
Asked by
Mina
Top achievements
Rank 1
Answers by
MasterChiefMasterChef
Top achievements
Rank 2
Share this question
or