I have a problem with binding of column header.
It's my class :
public string ErrorMessage { get; set; }
public TimeSpan? Duration { get; set; }
public string DefaultObjectTypeCd { get; set; }
public string DefaultObjectValue { get; set; }
public string ObjectTypes {
get {
string s = string.Empty;
foreach (LogObject o in LogObjects) {
if (string.IsNullOrEmpty(s))
s = o.Type;
else
s += "\n" + o.Type;
}
return s;
public string ObjectValues
{
get
foreach (LogObject o in LogObjects)
s = o.Value;
s += "\n" + o.Value;
and I will to bind ObjectValues properties for value and ObjectTypes as Label of column
<dataPresenter:UnboundField
BindingPath="ObjectValues"
Settings="{StaticResource ObjectHeaderGrid}"/>
and style
<dataPresenter:FieldSettings x:Key="ObjectHeaderGrid">
<dataPresenter:FieldSettings.LabelPresenterStyle>
<Style TargetType="{x:Type dataPresenter:LabelPresenter}" BasedOn="{x:Static igThemes:DataPresenterIGTheme.LabelPresenter}">
<!--<Setter Property="TextBlock.Text" Value="{Binding Path=DataItem.ObjectTypes}" />-->
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate>
<TextBlock Margin="8 2 0 0" Text="{Binding Path=DataItem.ObjectTypes}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</dataPresenter:FieldSettings.LabelPresenterStyle>
</dataPresenter:FieldSettings
The binding it's correct but I lose theme and the theme used for xamdatacards is ==> Theme="IGTheme".
and the result is
The column label is bind but the main theme lose.
Can you help me? how can I recover the main style(theme)??
the result is there sorry,
Hello,
Thank you for your email.
I have been looking into it and the code snippet that you have provided. It seems that the behavior that you have described is expected, because when using Template property you override the LabelPresenter of XamDataCards, so loose its styles. What I can suggest is to use ContentTemplate with DataTemplate into it instead of Template with ControlTemplate. You can set the DataContext property of TextBlock to the DataRecordCellArea and bind to the Record.Cells[ObjectTypes].Value. I created a short sample application based on your scenario to show you how you can achieve the functionality that you want. Please let me know if I missing something from your scenario.
Please let me know if you require any further assistance on the matter.
I am just checking your progress on the issue that you are having.
If you require any further assistance please do not hesitate to ask.