Hi All,
Can anyone help me in aliging the summary with the content in the column?
column A Column B
100 200
sun 100 sum 200
Thanks
Prakash
Hello Prakash,
You have to create a style for the summary presenter. You can find this default style in the DefaultStyles directory in the infragistics folder on your computer.
Hope this helps,Alex.
Hi Alex,
Here is code which i did.
But it does not align with the column value but it aligns with the column.
I want to make it aligned with the content of the column.
Let me know how to do that ?
<Style TargetType="{x:Type igDP:SummaryResultPresenter
}">
<Setter Property="HorizontalAlignment" Value
="Right"/>
<Setter Property="HorizontalContentAlignment" Value="Right"/>
</Style
>
<Style TargetType="{x:Type igDP:SummaryCellPresenter
<Setter Property="HorizontalContentAlignment" Value
<Style TargetType="{x:Type igDP:SummaryRecordPresenter
Prakash,
The numeric value editors by default have right alignment of the values. The text editors has left alignment. You can use converters like Andrew Smith has shown on this link (http://forums.infragistics.com/forums/p/22306/81648.aspx#81648) and this way you will get summaries right aligned for the numeric editors and left aligned for the text editors. With the default settings, this is working perfectly. If you apply your custom alignment, you would have to use another strategy and do this manually.
Alex.
I have tried that it works perfectly but it does not align correctly with the content of the field.
I have attached a gif file it show's the results in the grid with the summary
I am not quite sure why they are not aligned. It seems to me that they are centered. Here is a screenshot of what I am getting:
I am also attaching the sample project for you.
Regards,
This is the code which i am using to right align the summary content but it doesnot work
Do you know if i am missing anything in the code.
<Style TargetType="{x:Type igDP:SummaryResultPresenter}">
<Setter Property="HorizontalAlignment" Value="{Binding Path=SummaryResult.SourceField.EditAsTypeResolved, RelativeSource={RelativeSource Self}, Converter={StaticResource typeToHorzAlignment}}" />
</Style>
="BottomFixed"/>
="SingleView" >
<igDP:FieldLayout.SummaryDefinitions>
="Sum"/>
</igDP:FieldLayout.SummaryDefinitions>
</igDP:FieldLayout>
hi Alex,
Its working Perfectly.
Hi, in case someone's struggling with nullables I suggest to modify the convert method in the example above with something like the following:
public object Convert(.......){ Type innerType; Type t = value as Type; bool gen = t.IsGenericType; if (gen) { innerType = t.GetGenericArguments()[0]; } else { innerType = t; } if (innerType != null && Utilities.IsNumericType(innerType)) { return ......; } else return ........;