Set the button background color same as the Grid header

1 Answer 88 Views
Grid LinkButton
Deepu
Top achievements
Rank 1
Deepu asked on 18 Feb 2022, 03:26 AM

Hi, I am using a grid filter - Show/hide button in the <CommandItemTemplate> of RadGrid. I am using this for the filter to show on or off. But this radbutton has a different color than the Grid Header. I want to change its background to whatever color that the Grid has ( I may use different skin). Below is the code. Any way we can set the BackColor property of the button at Clientside itself? 

<MasterTableView CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Right" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
                                                <CommandItemTemplate>
                                                    <telerik:RadButton ID="btnFilter" runat="server" ButtonType="SkinnedButton" Font-Size="X-Small" OnClick="btnFilter_Click" Width="30px" Height="20px" Text="filter"></telerik:RadButton>
                                                </CommandItemTemplate>
                                                <Columns>

1 Answer, 1 is accepted

Sort by
0
Accepted
Doncho
Telerik team
answered on 22 Feb 2022, 12:24 PM

Hi Deepu,

You can use some custom CSS and restyle the button as per the current requirements. E.g. you can set its background-color to transparent:

<CommandItemTemplate>
    <telerik:RadButton ID="btnFilter" runat="server" ButtonType="SkinnedButton" CssClass="customButton" Font-Size="X-Small" Width="30px" Height="20px" Text="filter" ></telerik:RadButton>
</CommandItemTemplate>

CSS

html body .RadGrid .RadButton.customButton{
    background-image:none;
    background-color:transparent;
    border-color:transparent;
}
An alternative approach you can test is to set the Skin of the Button to be the same as the one set to the RadGrid:

<telerik:RadButton ID="btnFilter" runat="server" ButtonType="SkinnedButton" Font-Size="X-Small" Width="30px" Height="20px" Text="filter" Skin='<%# Container.OwnerTableView.OwnerGrid.Skin %>'></telerik:RadButton>

Please give these a try and let me know how it goes.

Kind regards,
Doncho
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Deepu
Top achievements
Rank 1
commented on 22 Feb 2022, 04:29 PM | edited

Hi Doncho, Thanks... ... ignore my previous comment.. it was by mistake for another rail.
Tags
Grid LinkButton
Asked by
Deepu
Top achievements
Rank 1
Answers by
Doncho
Telerik team
Share this question
or