Hi,
I would like to dynamically change the column headers of the detailview depending on the parent object. Is that possible? I want to bind the Header Text to the parent's (NameColumn1). Same for visibility. I think I should use RelativeSource but I don't know how. Here is a quick example:
<Syncfusion:SfDataGrid
ItemsSource="{Binding MyParents}">
<Syncfusion:SfDataGrid.DetailsViewDefinition>
<Syncfusion:GridViewDefinition RelationalColumn="MyChilds">
<Syncfusion:GridViewDefinition.DataGrid>
<Syncfusion:SfDataGrid>
<Syncfusion:GridTextColumn HeaderText="{Binding ??}" ValueBinding="{Binding ValueColumn1, Mode=OneWay}" IsHidden="{Binding ??}"/>
</Syncfusion:SfDataGrid>
</Syncfusion:GridViewDefinition.DataGrid>
</Syncfusion:GridViewDefinition>
</Syncfusion:SfDataGrid.DetailsViewDefinition>
</Syncfusion:SfDataGrid>
public class ViewModel
{
public ObservableCollection<MyParentClass> MyParents { get; set; }
}
public class MyParentClass
{
public bool ShowColumn1 => true;
public string NameColumn1 => "t1";
public ObservableCollection<MyChildClass> MyChilds { get; set; }
}
public class MyChildClass
{
public string ValueColumn1 = "foo";
}