Hi,
As per my requirement , I need to apply specific style for Cell.
Once you applied style, Cell will have Value, Border Color and image depends on the collection set it in binding.
To achieve above requirement..which Targettype need to be used to apply Style?
Thanks,
Chandra
Hello Chandra,
Thank you for post. If you are working with XamGrid, you need to create a style with target element “CellControl” :
http://help.infragistics.com/Help/NetAdvantage/WPF/2012.2/CLR4.0/html/Designers_Guide_Styling_Points_for_xamGrid.html
If working with the XamDataGrid, you need style for “CellValuePresenter” :
http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html
Let me know, if you need any further assistance on this matter
Hi Yanko,
I am using XamDataGrid Control. So I created style for CellvaluePresenter .
>>
<Style x:Key="InCellStyle" TargetType="{x:Type igDP:CellValuePresenter}" > <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <Border CornerRadius="2" Name="MainBorder" BorderThickness="2" BorderBrush="{Binding BorderColor,FallbackValue=Red}"> <StackPanel Orientation="Horizontal"> <TextBlock x:Name="TextBlock" Text="{Binding Value, FallbackValue=99,RelativeSource={RelativeSource Mode=TemplatedParent}}" /> <Image x:Name="Image1" Source="{Binding}"/> <!--<Image Width="Auto" Source="pack://application:,,,/WpfCustomControlLibrary7;component/Images/WarningImg.png" HorizontalAlignment="Right" x:Name="Image1" />--> </StackPanel> </Border> <!--</Border>--> <ControlTemplate.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CustomControl1}},Path=EnableWarningFlag}" Value="True"> <Setter Property="Source" TargetName="Image1" Value="pack://application:,,,/WpfCustomControlLibrary7;component/Images/WarningImg.png"></Setter> <Setter Property="BorderBrush" TargetName="MainBorder" Value="Blue"></Setter> </DataTrigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
<<
I want to apply CellvaluePresenter Style for specific cell.
How Can I achieve this?
If I apply above style, I need to get BorderColor ,Value and image in the Cell depends on specific properties
Could you please help me in this.