Do I have to use Expression Blend to style a column?

9 posts, 0 answers
  1. Wei
    Wei avatar
    6 posts
    Member since:
    May 2013

    Posted 03 Jun 2013 Link to this post

    Hi,
    Is there any way to style a column in the GridView without using Expression Blend? I couldn't find any guidance.

    Thanks!

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 04 Jun 2013 Link to this post

    Hi Wei,


    In general, grid view columns are not supposed to be styled in Expression Blend environment. In fact they are formed as a logical interception of rows and headers. You may alter the appearance of its elements through defining a style targeted at GridViewCell, GridViewHeaderCell, GridViewFooterCell etc. Which of these elements do you need to style? 




    Regards,
    Vanya Pavlova
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Wei
    Wei avatar
    6 posts
    Member since:
    May 2013

    Posted 04 Jun 2013 Link to this post

    Hi,
    I am trying to style GridViewCell. It seems all the online manual are using Expression Blend.
    http://www.telerik.com/help/wpf/radgridview-styles-and-templates-styling-radgridview.html

    I am not able to get a copy of Expression Blend and I think it's an overkill. I just want to setup some basic conditional background color style, red for negative numbers etc. Is there a simple easy way to do so? Either using xaml or c# is fine.

    Thanks!

    Wei
  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 04 Jun 2013 Link to this post

    Hi Wei,



    For those clients, who do not use Expression Blend we offer our themes as separate projects, which you can take from the Themes folder of your personal installation. If you need to alter the appearance of GridViewCell, based on underlying property value I believe that the CellStyleSelector is the way to go, please check our online demos here. The same is applicable to WPF as well.   




    Regards,
    Vanya Pavlova
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Wei
    Wei avatar
    6 posts
    Member since:
    May 2013

    Posted 05 Jun 2013 Link to this post

    Hi, 
    I tried to replicate the example. Copy the codes over to my project. For xaml, code snippet:

                <Style x:Key="PositiveValueStyle"
      TargetType="telerik:GridViewCell"
      BasedOn="{StaticResource GridViewCellStyle}">
                    <Setter Property="Background"
    Value="{StaticResource AccentBrush}" />
                    <Setter Property="Foreground"
    Value="{StaticResource MainBrush}" />
                </Style>

    is causing error. It keeps saying "The resource GridViewCellStyle/AccentBrush/MainBrush can't be resolved." 
    I couldn't find how to reference them. Could you help me?

    Thanks!

  6. Wei
    Wei avatar
    6 posts
    Member since:
    May 2013

    Posted 05 Jun 2013 Link to this post

    BTY, is there any documentation for this? I totally have no idea how it works.
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 06 Jun 2013 Link to this post

    Hello Wei,



    Most probably you do not reference NoXAML binaries and by that reason you are getting this error.
    Indeed we have an article related to implicit styles in our documentation, which you can check following this link. Furthermore in our forums we have a thread, which describes the difference between StyleManager and implicit styles, you may find it here.  




    Regards,
    Vanya Pavlova
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Wei
    Wei avatar
    6 posts
    Member since:
    May 2013

    Posted 06 Jun 2013 Link to this post

    I found that it works by removing BasedOn="{StaticResource GridViewCellStyle}"

    Thanks!
  9. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 06 Jun 2013 Link to this post

    Hello Wei,

     

    Please keep in mind that after removing the BasedOn attribute, because you use standard binaries, not NoXAML ones. The BasedOn attribute is primarily used with NoXAML binaries in order to inherit base styles.  


    If you encounter any other issues do not hesitate to contact us!
    Have a great day!


    Regards,
    Vanya Pavlova
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top