Vijay

Vijay

  • NA
  • 150
  • 90.6k

How to implement datatemplate for gridcolumn from WPF MVVM

Jun 18 2018 7:48 AM
I am using below code for highlight red color boder for textbox.combobox when condition true from XAML.
  1. <DataTemplate>  
  2. <Border x:Name="outerCellBorder">  
  3. <dxe:InplaceBaseEdit Name="PART_Editor" ContentTemplate="{x:Null}"/>  
  4. </Border>  
  5. <DataTemplate.Triggers>  
  6. <MultiDataTrigger>  
  7. <MultiDataTrigger.Conditions>  
  8. <Condition Binding="{Binding Path=RowData.Row.Name}" Value="{x:Null}"/>  
  9. <Condition Binding="{Binding Path=RowData.Row.IsPersonHasValue}" Value="true"/>  
  10. </MultiDataTrigger.Conditions>  
  11. <Setter TargetName="outerCellBorder" Property="BorderBrush" Value="Red" />  
  12. <Setter TargetName="outerCellBorder" Property="BorderThickness" Value="1" />  
  13. <Setter Property="ToolTip" Value="Please enter name"/>  
  14. </MultiDataTrigger>  
  15. </DataTemplate.Triggers>  
  16. </DataTemplate>  
How to implement same functionality from WPF Codebehind or MVVM. Here, I am using Generic ViewModel like
  1. public class PersonViewModel<T> : PersonViewModel where T : new()  
  2. {}  
Please anyone help me on this.