Hi,
The datagrid in my application has multiple Summarydefinitions as row summaries for the same field.
They are placed one below the other. I want to right align the value part of the summary definitions. I am
finding difficult to implement a custom template targeting the rowsummary. Is there a way by which we
make use of the grid in the custom template placing header and value in seperate columns so that we
can align the items appropriatly?
ex: Stringformat = "Amount: {}{0:C}" placing Amount in one column and the value in other.
Please do send me a code snippet if this is possible.
Thanks in advance.
Hello Aaron,
Thanks for the info, i think i just overlooked the item. It works great.
Thanks
Toreador,
I don't see a Mask property for the Texbblock so using the xamTextEditor, I believe you would have to bind the xamTextEditor's Value property to the value of the SummaryResultPresenter's SummaryResult.Value Path.
Thanks Alex, it works great except that i am unable to set mask on the Textblock. I tried using
xamMaskedEditor instead but iam unable to see the value population . Any ideas on what i m missing
here.
Hello,
The following code snippet will do the trick:
<Style TargetType="{x:Type igDP:SummaryResultPresenter}">
<Setter Property="Padding" Value="1,1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:SummaryResultPresenter}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
Padding="{TemplateBinding Padding}"
ToolTip="{Binding Path=SummaryResult.ToolTipResolved, RelativeSource={RelativeSource TemplatedParent}}">
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=SummaryResult.SummaryDefinition.Calculator, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Foreground="BurlyWood" Text="{Binding Path=SummaryResult.Value, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Right"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0,0,0,0"/>
</Style>
We ship the generic styles for your components and you can find them in the DefaultStyles directory in the Infragistics Folder on your computer.