0
<c1:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox x:Name="chkBxIsChecked" IsChecked="{Binding IsChecked, Mode=TwoWay}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding IsVisible, Mode=TwoWay}" >
<Image Name="ErrorImage" Visibility ="{Binding IsImgVisible, Mode=TwoWay}" Source= "../../../Resources/Images/Fail.png" Height="16" Width="16" Margin="5,0,0,0"></Image>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<t:MapEventToCommand Command="{Binding Source={StaticResource TestVM},Path=IsCkCommand}" CommandParameter="checked" />
</i:EventTrigger>
<i:EventTrigger EventName="Unchecked">
<t:MapEventToCommand Command="{Binding Source={StaticResource TestVM},Path=IsCkCommand}" CommandParameter="unchecked" />
</i:EventTrigger>
</i:Interaction.Triggers>
</CheckBox>
</DataTemplate>
</c1:DataGridTemplateColumn.CellTemplate>
</c1:DataGridTemplateColumn>
我想隱藏基於從數據庫中的數據列,並顯示圖像的複選框同一列單元格有條件添加圖片和隱藏複選框。 我正在嘗試上述方法,但無法顯示圖像時,我做了可見性.collapse複選框。 我可以做到這一點從代碼隱藏? ,請給我建議。 測試一個記錄在附加圖像我期待顯示圖像,而不是checkbo,因爲它顯示爲空,因爲我使可見性摺疊對行。DataGridTemplateColumn.CellTemplate如何
在此先感謝。
非常感謝它正在工作 – user3125908 2014-09-28 16:47:41