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

StyleRule Condition Expression Through the CS dynamic generation what

0 Answers 184 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ZHANG
Top achievements
Rank 1
ZHANG asked on 06 Jun 2012, 02:13 AM

Who can help me ah, thank you.

,The following code bold information, how to pass the background ( CS) dynamically generated.?

<telerik:RadGridView x:Name="RadGridView1"  AutoGenerateColumns="False" MinHeight="386" MaxHeight="500" Width="700"
                          CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed">
            <telerik:RadGridView.RowStyleSelector>
                <telerik:ConditionalStyleSelector>
                    <telerik:StyleRule Condition=" (UnitPrice&gt;50 and UnitPrice&lt;60) or ProductName='1行 '">
                        <!--GridViewCell &gt为大于,&lt为小于-->
                        <Style TargetType="telerik:GridViewRow">
                            <Setter Property="Background" Value="#7F2FB3FD" />
                            <Setter Property="Foreground" Value="Red" />
                        </Style>
                    </telerik:StyleRule>
                </telerik:ConditionalStyleSelector>
            </telerik:RadGridView.RowStyleSelector>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Product Name" DataMemberBinding="{Binding Path=ProductName,Mode=TwoWay}"/>
                <telerik:GridViewDataColumn Header="UnitPrice" DataMemberBinding="{Binding Path=UnitPrice,Mode=TwoWay}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

<telerik:RadGridView x:Name="RadGridView1"  AutoGenerateColumns="False" MinHeight="386" MaxHeight="500" Width="700"                          CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed">            <telerik:RadGridView.RowStyleSelector>                <telerik:ConditionalStyleSelector>                    <telerik:StyleRule Condition=" '">                        <!--GridViewCell &gt为大于,&lt为小于-->                        <Style TargetType="telerik:GridViewRow">                            <Setter Property="Background" Value="#7F2FB3FD" />                            <Setter Property="Foreground" Value="Red" />                        </Style>                    </telerik:StyleRule>                </telerik:ConditionalStyleSelector>            </telerik:RadGridView.RowStyleSelector>            <telerik:RadGridView.Columns>                <telerik:GridViewDataColumn Header="Product Name" DataMemberBinding="{Binding Path=ProductName,Mode=TwoWay}"/>                <telerik:GridViewDataColumn Header="UnitPrice" DataMemberBinding="{Binding Path=UnitPrice,Mode=TwoWay}"/>            </telerik:RadGridView.Columns>        </telerik:RadGridView>
Tags
GridView
Asked by
ZHANG
Top achievements
Rank 1
Share this question
or