zoukankan      html  css  js  c++  java
  • gridcontrol datatemplate trigger


                            <TextBlock Name="textBlock" HorizontalAlignment="Left" Text="{Binding Value}"></TextBlock> 绑定的cell里面的值
                            <DataTemplate.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Path=Column.FieldName}" Value="test"/> //去该列的列头名称
                                        <Condition Binding="{Binding Path=Value,Converter={StaticResource summaryColorConvert}}" Value="True"/>
                                    </MultiDataTrigger.Conditions>
                                    <MultiDataTrigger.Setters>
                                        <Setter Property="Foreground" Value="Red" TargetName="textBlock"/>
                                    </MultiDataTrigger.Setters>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Path=Column.FieldName}" Value="test1"/>
                                        <Condition Binding="{Binding Path=Value,Converter={StaticResource summaryColorConvert}}" Value="False"/>
                                    </MultiDataTrigger.Conditions>
                                    <MultiDataTrigger.Setters>
                                        <Setter Property="Foreground" Value="Green" TargetName="textBlock"/>
                                    </MultiDataTrigger.Setters>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Path=Column.FieldName}" Value="test2"/>
                                        <Condition Binding="{Binding Path=Value,Converter={StaticResource summaryColorConvert}}" Value="True"/>
                                    </MultiDataTrigger.Conditions>
                                    <MultiDataTrigger.Setters>
                                        <Setter Property="Foreground" Value="Red" TargetName="textBlock"/>
                                    </MultiDataTrigger.Setters>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Path=Column.FieldName}" Value="test4"/>
                                        <Condition Binding="{Binding Path=Value,Converter={StaticResource summaryColorConvert}}" Value="False"/>
                                    </MultiDataTrigger.Conditions>
                                    <MultiDataTrigger.Setters>
                                        <Setter Property="Foreground" Value="Green" TargetName="textBlock"/>
                                    </MultiDataTrigger.Setters>
                                </MultiDataTrigger>
                            </DataTemplate.Triggers>


                                <DataTemplate.Triggers>
                                    <DataTrigger Binding="{Binding Value}" Value="nouse">
                                        <Setter Property="Visibility" Value="Hidden" TargetName="dropDownButton"/>
                                    </DataTrigger>
                                </DataTemplate.Triggers>

                               当该列的值cell值为nouse时 隐藏该列的dropDownButton

  • 相关阅读:
    iOS UI(布局)约束是什么?view1.attr1 = view2.attr2 * multiplier + constant
    编程范式-声明式编程
    平庸的投资人和优秀的投资人差在哪儿
    编程语言的发展趋势及未来方向
    再读:编程语言的发展趋势及未来方向
    编程语言的发展趋势:声明式动态并发
    命令式编程与声明式编程
    声明式(编程)语言是解释型语言
    DSL-领域特定语言(英语:domain-specific language、DSL)
    声明式编程
  • 原文地址:https://www.cnblogs.com/tianmochou/p/6178987.html
Copyright © 2011-2022 走看看