Make RadGridView Transparent

7 posts, 0 answers
  1. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 27 Oct Link to this post

    Hi,

    Is there any simple way to make whole RadGridView transparent?

    I mean Headers, Rows, Vertical and Horizontal scrollbars, etc.

    Setting "Background" property sets only data row area where no rows are created.

    I am using 2015 Q3.

    Thanks,

    Łukasz

     

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 28 Oct Link to this post

    Hello Lukasz,

    I'm unsure about your exact requirements, but I believe simply setting RadGridView's Opacity property would result in the desired effect as it will propagate down the visual tree to all child elements.

    Could you please give this a try and let me know if it works for you? If that is not the case, please provide more details on the exact result you're trying to achieve and I will gladly assist you further.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 28 Oct in reply to Dilyan Traykov Link to this post

    Hi,

    I would like to change background brush of all elements of RadGridView, but leave foreground parts intact. I tried to add Opacity but it is added to cell text values and images, column headers, scrollbars, etc.

     

     

     

  5. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    371 posts

    Posted 28 Oct Link to this post

    Hello Lukasz,

    Unfortunately, there's no simple way to achieve the desired effect, other than traversing the visual tree and setting the desired properties for each individual element or defining the appropriate styles targeting the necessary elements.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
  6. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 29 Oct in reply to Dilyan Traykov Link to this post

    It looks like it is:

    <Grid Background="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MainBrush}}" Opacity="0.85">
        <telerik:RadGridView>
        [...]
    </Grid>

     

    This code applies background color with opacity to all descending elements.

  7. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 29 Oct in reply to Lukasz Link to this post

    Sorry, I posted it too fast. Here is a complete solution:

    <Grid Background="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MainBrush}}" Opacity="0.85">
        <telerik:RadGridView

                Background="Transparent"
                  ColumnBackground="Transparent"

         >
        [...]
    </Grid>

     

    This way I can put a RadGridView and other elements on <Grid> with a little transparency.
  8. Stefan X1
    Admin
    Stefan X1 avatar
    521 posts

    Posted 02 Nov Link to this post

    Hello Lukasz,

    We are glad that you have managed to find a solution that suits your needs. Thank you for sharing it with the community.

    All the best,
    Stefan X1
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top
UI for WPF is Visual Studio 2017 Ready