DataGridTemplateColumn

DataGridTemplateColumn

本文介绍了如何为datagrid设置列模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个包含真假值的查询。 如果值为true表示在通话中,则表示拨打电话。 我尝试了一些但是有如下错误。有什么问题 严重程度代码说明项目文件行抑制状态 错误无法找到触发器目标'vbGelenCagriMi'。 (目标必须出现在使用它的任何Setter,Triggers或条件之前。)第58行位置73. CallCenter C:\Users\developer\Documents\Visual Studio 2015 \Projects\CallCenter \CallCenter \\ \\ Pages \PgGorusmeler.xaml 我尝试过: < DataGrid.Columns> < DataGridTemplateColumn> < DataGridTemplateColumn.CellTemplate> < DataTemplate> < Button Background =LightSkyBlueClick =btnGorusmeBaslat_Click> ARA< / Button> < / DataTemplate> < /DataGridTemplateColumn.CellTemplate> < / DataGridTemplateColumn> < DataGridTemplateColumn> < DataGridTemplateColumn.CellTemplate> < DataTemplate> < Rectangle Horizo​​ntalAlignment =LeftHeight =18Margin =10,19,0,0VerticalAlignment =TopFill =LightSkyBlueWidth =18> < Rectangle.OpacityMask> < VisualBrush x:Name =vbGelenCagriMiVisual ={DynamicResource appbar_arrow_down}Stretch =Fill/> < /Rectangle.OpacityMask> < / Rectangle> < DataTemplate.Triggers> < DataTrigger Binding ={Binding GelenCagriMi}Value =false> < Setter TargetName =vbGelenCagriMiProperty =VisualValue ={DynamicResource appbar_arrow_up}/> < / DataTrigger> < /DataTemplate.Triggers> < / DataTemplate> < /DataGridTemplateColumn.CellTemplate> < / DataGridTemplateColumn> 解决方案 I have a query which contains a true false value.If the value is true that means in call, else means outgoing call.I have tried something but there is an error like below. What is the wrongSeverityCodeDescriptionProjectFileLineSuppression StateErrorCannot find the Trigger target 'vbGelenCagriMi'. (The target must appear before any Setters, Triggers, or Conditions that use it.) Line 58 Position 73.CallCenterC:\Users\developer\Documents\Visual Studio 2015\Projects\CallCenter\CallCenter\Pages\PgGorusmeler.xamlWhat I have tried:<DataGrid.Columns> <DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button Background="LightSkyBlue" Click="btnGorusmeBaslat_Click">ARA</Button> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Rectangle HorizontalAlignment="Left" Height="18" Margin="10,19,0,0" VerticalAlignment="Top" Fill="LightSkyBlue" Width="18"> <Rectangle.OpacityMask> <VisualBrush x:Name="vbGelenCagriMi" Visual="{DynamicResource appbar_arrow_down}" Stretch="Fill"/> </Rectangle.OpacityMask> </Rectangle> <DataTemplate.Triggers> <DataTrigger Binding="{Binding GelenCagriMi}" Value="false"> <Setter TargetName="vbGelenCagriMi" Property="Visual" Value="{DynamicResource appbar_arrow_up}"/> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> 解决方案 这篇关于如何为datagrid设置列模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-21 01:57