Hi,
I try to use the XamPivot to display Data...
I want to know how i can customize the columnHeader to bind more than property ..
A want to display another information with A-136... in this column
the XAML way please.
Thx
Hello Michel,
Thank you for your update on this matter, but I have to admit, I’m slightly confused by your most recent response in this case.
Is your most recent response to say that you have achieved your requirement by formatting all of your data in your “SlaughterPeriodName” property in this case, or do you still need assistance in achieving this behavior?
Thx,
I have to display more info about "A-136" like this
I 'm doing this display by formating all data in the single property like this.
SlaughterPeriodName = $" [{preOrderPeriod.SlaughterPeriodName}] [{effectiveRate}%] {Environment.NewLine} {range.StartPeriod.Value.ToShortDateString()} {range.EndPeriod.Value.ToShortDateString()}";
thx
Thank you for your update on this matter. It is a rather complex example, but that is mainly because the styles for PivotColumnHeaderCellControl and PivotRowHeaderCellControl have quite a few dependencies on other styles. The actual changes are in that ContentControl.ContentTemplate, as it appears you have noticed.
Regarding binding the TextBlock, it really depends on what "propertyName1/2/3" exists on in this case for me to really be able to make a recommendation. For example, does this property exist on the view model in your application that likely contains the data source that you are binding to the XamPivotGrid, or are these properties actually on the underlying data item that in your screenshot above is referenced by the "A-136" column in this case?
Would it be possible for you to please provide some information on the above so I may be able to make a recommendation in this case?
is complex example
if i understand all the job i done in this section :
<ContentControl.ContentTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"><TextBlock Text="{Binding}"/> <TextBlock Text=" SOME CUSTOM COLUMN TEXTTTTT"/> </StackPanel> </DataTemplate> </ContentControl.ContentTemplate>
i wan't to hard code the Text but something like that
<TextBlock Text="{Binding propertyName1}"/>
<TextBlock Text="{Binding propertyName2}"/>
<TextBlock Text="{Binding propertyName3}"/>
How i can acomplish this... an example please.
In order to customize a column or row header in the XamPivotGrid, I would recommend including the default templates for PivotColumnHeaderCellControl and PivotRowHeaderCellControl. These default templates can be found in the generic.shared.xaml file commonly found at the following directory:
C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\XamPivotGrid
Once you have included these default styles and their dependencies, I would recommend that you locate a ContentControl named “HeaderPresenter” in each default template. Here, you can provide a ContentTemplate that can bind to the element you wish to bind to.
I am attaching a sample project that demonstrates this. I am rather unsure what you are looking to bind to in this case, and so the modification of the ContentControl.ContentTemplate in the case of the sample project is bound to the Content of the ContentControl, which is the normal header as well as the addition of some generic text.
Please let me know if you have any other questions or concerns on this matter.
PivotGridFlatDataTest.zip