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

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

8 Answers 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Wei
Top achievements
Rank 1
Wei asked on 03 Jun 2013, 08:29 PM
Hi,
Is there any way to style a column in the GridView without using Expression Blend? I couldn't find any guidance.

Thanks!

8 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 04 Jun 2013, 07:23 AM
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.

0
Wei
Top achievements
Rank 1
answered on 04 Jun 2013, 11:10 AM
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
0
Vanya Pavlova
Telerik team
answered on 04 Jun 2013, 02:14 PM
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.

0
Wei
Top achievements
Rank 1
answered on 05 Jun 2013, 06:07 PM
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!

0
Wei
Top achievements
Rank 1
answered on 05 Jun 2013, 06:41 PM
BTY, is there any documentation for this? I totally have no idea how it works.
0
Vanya Pavlova
Telerik team
answered on 06 Jun 2013, 07:12 AM
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.

0
Wei
Top achievements
Rank 1
answered on 06 Jun 2013, 01:23 PM
I found that it works by removing BasedOn="{StaticResource GridViewCellStyle}"

Thanks!
0
Vanya Pavlova
Telerik team
answered on 06 Jun 2013, 01:29 PM
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.

Tags
GridView
Asked by
Wei
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Wei
Top achievements
Rank 1
Share this question
or