Hello again:
How to style the summary row? I want grid-lines between the summaries and the ability to bold, set background and foreground etc.
I was looking at 'GroupByRecordPresenter' is this the correct approach? It appears to be formatting the column header not the Summary Row.
Even better (hint, hint ;) can you write a small sample to show gridlines and set the background foreground and font weight to bold?
Also how to insert a screenshot? I have no idea what the URL might be. Ie how to upload the image and then retrieve the url?
Thx
Hi Narendra,
Thank you for your reply. I have been looking into your questions and I created a sample application(DataGridSummaryDefinitionSample.zip) where I am using your converter.
Let me know, if you need any further assistance on this matter.
In future please create a separate forum thread for each of your new questions.
Thank you for understanding.
That worked! To recap and three questions, I'm using a converter as suggested but:
1. I feel there is a XAML only solution. Ie how in the trigger can I specify a StaticResource for the ColumnName or Key something like (which is totally wrong) :
<DataTrigger Binding="{Binding {Name}}" Value="Bucket"> <!-- Very wrong and very bad code -->
2. Notice the Margin="5,0,5,0", which means all the summary cells have both left and right margins, dosen't feel right to me...
3. How can I upload nice image and nicely formatted code with scroll bars like other folks?
XAML:
<Style TargetType="{x:Type igDP:SummaryResultPresenter}"> <Setter Property="HorizontalContentAlignment" Value="Right"/>
<Setter Property="Template">
<Setter.Value> <ControlTemplate TargetType="{x:Type igDP:SummaryResultPresenter}"> <Border <TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="5,0,5,0" Text="{Binding Path=SummaryResult.DisplayTextAsync, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/> </Border>
<ControlTemplate.Triggers> <DataTrigger Binding="{Binding Converter={StaticResource FieldNameToBoolConverter}}" Value="True"> <Setter Property="HorizontalContentAlignment" Value="Left"/> </DataTrigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
...
<igDP:SummaryDefinition SourceFieldName="Bucket" Calculator="Sum" StringFormat="{}{0:0,0}"/>
CodeBehind:
public class FieldNameToBoolConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var name = ((Infragistics.Windows.DataPresenter.SummaryResult) value).SourceField.Name; return name == "Bucket" ? true : false; }
}
Hi Nar,
Thank you for your posts. I have been looking into your second question and in order to apply different style for each SummaryResultPresenter you need to use DataTriggers as shown in the following forum thread:
http://es.infragistics.com/community/forums/t/50050.aspx
I found an answer that works for me
http://es.infragistics.com/community/forums/t/48471.aspx
One question. how can I set the summary style differently for the first column? I want that text to be Left justified.