Greetings,
I am trying to create a ControlTemplate for a GridViewCell. The only real change in my template is the addition of another component - a status indicator (PropertyStatus) that will be placed in each cell. I am trying to position the status indicator directly to the right of the cell's AlignmentContentPresenter...To keep things simple, here is the relevant snippet from the control template I am trying to create:
So, if you haven't already noticed, the PropertyStatus control needs to be able to set a property named Property which is the name (string) of the column's bound property name. To gain access to the name of the bound property in C#, one would do something like "GridViewCell.Column.UniqueName". Make sense? Without much confidence, in the control template above, I tried Property="{TemplateBinding Column.UniqueName}" which failed to work.
Two questions:
(1) Any thoughts on how i could access the cell's column's unique name from the control template and use it to set the Property property on my PropertyStatus control?
(2) In my cell's template i see a ContentPresenter and an AlignmentContentPresenter. Can you explain the difference and when each are used? I want to make sure that i am positioning my component next to the appropriate ContentPresenter.
Thanks a bunch!
I am trying to create a ControlTemplate for a GridViewCell. The only real change in my template is the addition of another component - a status indicator (PropertyStatus) that will be placed in each cell. I am trying to position the status indicator directly to the right of the cell's AlignmentContentPresenter...To keep things simple, here is the relevant snippet from the control template I am trying to create:
<StackPanel Orientation="Horizontal"> |
<Telerik_Windows_Controls_GridView:AlignmentContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="3,33.5,2,0" x:Name="PART_ContentPresenter" VerticalAlignment="Top" Visibility="Visible" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" TextAlignment="{TemplateBinding TextAlignment}" TextDecorations="{TemplateBinding TextDecorations}" TextWrapping="{TemplateBinding TextWrapping}"/> |
<csla:PropertyStatus Property="{TemplateBinding Column.UniqueName}" Source="{Binding}"/> |
</StackPanel> |
So, if you haven't already noticed, the PropertyStatus control needs to be able to set a property named Property which is the name (string) of the column's bound property name. To gain access to the name of the bound property in C#, one would do something like "GridViewCell.Column.UniqueName". Make sense? Without much confidence, in the control template above, I tried Property="{TemplateBinding Column.UniqueName}" which failed to work.
Two questions:
(1) Any thoughts on how i could access the cell's column's unique name from the control template and use it to set the Property property on my PropertyStatus control?
(2) In my cell's template i see a ContentPresenter and an AlignmentContentPresenter. Can you explain the difference and when each are used? I want to make sure that i am positioning my component next to the appropriate ContentPresenter.
Thanks a bunch!