Guys, what would cause the column header to be rendered out of alignment with the column itself as shown in the screen capture below?
Hi,
Have you templated any of the xamDataPresenter elements, specifically the ExpansionIndicaor or the DataRecordPresenter.
I’ve seen similar behavior when the ExpansionIndicator was templated.
I have styles defined for the CellValuePresenter but none of them explicitly alter the ExpansionIndicator. It is a tricky one.
Turns out that I was setting ExpansionIndicatorVisibility to Hidden instead of Collapsed in the InitializeRecord and RecordExpanded event handlers as illustrated below:
private void DataGrid_InitializeRecord(object sender, InitializeRecordEventArgs e)
{
if (e.Record.HasChildren)
e.Record.ExpansionIndicatorVisibility = Visibility.Visible;
else
e.Record.ExpansionIndicatorVisibility = Visibility.Hidden;
}
private void DataGrid_RecordExpanded(object sender, RecordExpandedEventArgs e)
var childRecord = e.Record;
if (childRecord.ViewableChildRecords.Count > 0)
childRecord.ViewableChildRecords[0].ExpansionIndicatorVisibility = Visibility.Hidden; }
Changing ExpansionIndicatorVisibility for the record from Hidden to Collapsed fixed this.
Thank you for the update and I’m glad the question was resolved.
Please let me know if I can be of further assistance.