Hi,
I would like to know how can I do to make the SummaryRow in bold depending if any of the records inside is in bold also (similar to outlook style).
Any help is welcomed.
Cheers,
Federico
Federico,
I'm sorry for the delay. Accoring to your description you may consider another implementation with a multivalueconverter where you can pass the SummaryResult.Value along with the whole SummaryResult object that can be later used to obtain the name of the field. In the converter you will check the field name and store the summary value in custom variable. Then you can use this variable for all of the other fields.
Here is a quick snippet:
<Style TargetType="{x:Type igDP:SummaryResultPresenter}"> <Setter Property="TextBlock.FontWeight"> <Setter.Value> <MultiBinding Converter="{StaticResource multiColorConverter}"> <Binding Path="SummaryResult" RelativeSource="{RelativeSource Self}"/> <Binding Path="SummaryResult.Value" RelativeSource="{RelativeSource Self}"/> </MultiBinding> </Setter.Value>
</Setter>
</Style>
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{ SummaryResult result = values[0] as SummaryResult; string fieldName = (result.SourceField as Field).Name;
if (fieldName == "Field1") {
//check the value using values[1] and save it in a boolean variable } else if (fieldName == "Field2") { //check the boolean variable and return appropriate FontWeight } return Binding.DoNothing;}
I hope this helps.
Hi Vlad,
Thanks again for your answer. I must be doing something wrong I did exactly what it says in that thread and my converter gets executed for each column that has a summary. I want to evaluate just one summary (the first) and then if that is true put the whole row in bold and if that changes to false put the row back to Normal.
The Summaries are changing all the time as I receive updates frequently. What I am trying to do is to mark in bold when a row is updated (which I have done) and if that row is in a group mark the group in bold. When the user reads the row by clicking on it, it should go back to normal as the group.
Here is the definition of my XamDataGrid:
<
igDP:XamDataGrid Grid.Row="1" DataSource="{Binding LoadedEvents
}"
="Grid_Loaded"
RecordActivating
="XamDataGrid_RecordActivating"
>
FieldSettings
AllowEdit
="False"
="Always"
="True"
="SelectCell, SelectRecord"
/>
AllowClipboardOperations
="Copy"
HeaderPlacement
="OnTopOnly"
FilterUIType
="Default"
="SummaryCellsAlwaysBelowDescription"
="FieldChooserButton"
="True" />
="Descending"/>
="Ascending"/>
SummaryDefinition
="IsUpdatedFromCPS"
="{}{0}"
.BooleanCalculator}"/>
="EventType"
.DistinctString}"/>
="EAID"
="Symbol"
="Sedol"
="Country"
="Date"
="{}{0:mm/dd/yyyy}"
="BasketMdSymbol"
="BasketDescription"
="BasketID"
="BasketOwner"
="Election"
="Status"
="UnderlyerQuantity"
="{}{0:#,##0.00####}"
="Sum"/>
="EntitlementQuantity"
="EntitlementMdSymbol"
="EntitlementTakedown"
="OpsSignOffUser"
="DeskSignOffUser"
="UpdateUser"
="IsMandatory"
="EventStatusDescription"
="PayoutType"
="EventID"
="EventVersion"
<!--<igDP:Field Name="UpdatedImage" Label="" Width="22">
<igDP:Field.Settings>
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource UpdatedColumnTemplate}"/>
</igDP:Field.Settings>
</igDP:Field>-->
="0"/>
="105"/>
="80"/>
="60"/>
="60">
}"/>
="Basket MdSymbol"/>
="Basket Description"/>
="Basket Id"/>
="75"/>
="95"/>
="80">
="70">
="70"/>
="45">
}">
<!--<Setter Property="TextBlock.FontWeight" Value="{Binding Path=SummaryResult, RelativeSource={RelativeSource Self}, Converter={StaticResource boldConverter}}" />-->
}}" />
<!-- Style for field chooser -->
="SameAsDataPresenter"/>
<!--<Setter Property="DisplayHiddenFieldsOnly" Value="true"/>-->
..
My converter:
public
object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is bool && (bool)value)
return FontWeights.Bold;
}
else
return FontWeights.Normal;
I would really appreciate if you can point me to the right direction.
Regards,
Check out the following forum thread:
http://community.infragistics.com/forums/p/44757/243679.aspx#243679
Thanks for your reply. I could make one column in bold with the above snippets but I need to put in bold the whole row. Is there anyway to do that?
Thanks in advance,
In case you need to change the text's style of the summary result in each cell to bold based on some other logic then you might be interested in seeing the these forum threads:
http://community.infragistics.com/forums/p/44757/243396.aspx#243396
http://blogs.infragistics.com/forums/p/36665/212603.aspx#212603
Let me know if this is what you are looking for or I'm missing something.