Hi,
I am using a xamdatagrid unbound field to display values in grid. Also in one column I want to Display values as subscript and superscript. So I have given a style for cell value presenter and I am using a control template inside that style. In the control template I am using a label to display value as script. I have added script property to my label to display subscript and superscript.
<Style TargetType="{x:Type igGrid:CellValuePresenter }" BasedOn="{StaticResource CellBorderStyle}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igGrid:CellValuePresenter}"> <Border Background="{StaticResource BackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <MyLabel Script="{Binding Path=ABC, Mode=TwoWay}" > <MyLabel> </Border>
</ControlTemplate> </Setter.Value> </Setter> </Style>
Script is getting displayed fine. I have 4 static cells in this unbound field. I want to give white colour to bottom border of first cell and third cell. And to retain black for the border of other cells. In the attached image, I have marked the lines in red, which has to be made it as white in my grid. Please provide solution for this.
Regards,
Sasikumar
Hello Sasikumar,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I copied the default Style of the CellValuePresenter and added another Border to the Template, which I make visible or not based on the Index of the Record. I achieved that using DataTriggers. Also you can modify the template, so it uses your MyLabel control. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.