How to set theme to RadButton in RadGridView

2 posts, 0 answers
  1. Ofer
    Ofer avatar
    14 posts
    Member since:
    Apr 2009

    Posted 25 Jun 2009 Link to this post

    Hi,

    I saved a RadButton theme in an XML file and it's in the project's Resources file.
    It's available in the Properties.Resources.RedGridButton class.

    I have a RadGrid with a Command Column and I need to set the theme of its default RadButton.
    But the grid's CellFormatting event exposes just the buttonElement of the command column.
    How to set the button's theme?

    Thanks!
  2. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 01 Jul 2009 Link to this post

    Hello Ofer,

    Thank you for your question.

    Themes can be set only at a control level, but not at an element level. This is the reason why you cannot set a theme for the buttons in the GridViewCommandColumn - because they are RadButtonElements. 

    In order to apply a custom style to RadButtonElement in RadGridView you should create themes for RadButton and RadGridView with one and the same ThemeName. Then, when you set the custom ThemeName to RadGridView control, the custom RadButton style will automatically be applied to RadButtonElement. I am attaching a sample project which demonstrates the approach.

    If you have additional questions, feel free to contact me.

    All the best,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top