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

Predefined buttons in Command Item

1 Answer 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 28 May 2014, 01:32 PM
Currently the predefined buttons like Add new record, Refresh etc. are rendered in 2 elements:
1. an input button displaying an icon only
2. a link displaying a text

In some skins (e.g. Silk) such buttons are not prominent enough so a rad button with an icon would work much better. E.g. to Add & Refresh buttons on this page to be replaced with corresponding buttons from here .
For sure, it can be done by using CommandItem Template but it seems to be much re-work required. 
I wonder is there an easy way to achieve it by using built-in radGrid settings or css?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 02 Jun 2014, 06:55 AM
Hello,

If you would like to customize the CommandItem the easiest way would be to use a CommandItemTemplate. In it you could add the controls that are needed. When adding Button controls you could also set the CommandName property in the markup. This way no additional code would be required.

For example, the following CommandItemTemplate includes Add and refresh buttons:

<CommandItemTemplate>
    <telerik:RadButton ID="AddButton" runat="server" Text="Add" CommandName="InitInsert" Skin="Silk">
        <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="3"></Icon>
    </telerik:RadButton>
    <telerik:RadButton ID="RefreshButton" runat="server" Text="Refresh" CommandName="RebindGrid" Skin="Silk">
        <Icon SecondaryIconCssClass="rbRefresh" SecondaryIconRight="4" SecondaryIconTop="3"></Icon>
    </telerik:RadButton>
</CommandItemTemplate>



Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Viktor Tachev
Telerik team
Share this question
or