In the Xaml I am able to achieve removing all the headers on a page with the following code:
<Grid Name="mainGrid">
<Grid.Resources>
<Style x:Key="key1" TargetType="{x:Type igWPF:PaneHeaderPresenter}">
<Setter Property="MinHeight" Value="0"/>
<Setter Property="MaxHeight" Value="0"/>
</Style>
</Grid.Resources>
However I would like to do it programatically from the codebehind (possibly by binding the toggle to a checkbox) to allow users to decide whether or not they can see grid headers and move contentPanes within the XamDockManager
Thanks
(also, I posted the same question here: http://ko.infragistics.com/community/forums/p/90496/447231.aspx#447231 without realizing that this section was a better place for it. Please feel free to lock/remove that one, thanks).
Hello Christian,
To hide and unhide the headers through code-behind, I handled the Checked and Unchecked events of the checkbox and then used Utilities.GetDescendantFromType to retrieve the PaneHeaderPresenter from each of the ContentPanes. Then, I just set the Min and Max height of these PaneHeaderPresenters to 0.
The Unchecked handler is very much the same, except the MaxHeight gets set to something other than 0 in that one.
To hide and unhide them through data binding to that checkbox, I wrote a Style that uses data triggers that target the checkbox’s IsChecked property. If it is true, it hides the header.
I have attached a sample demonstrating the above. Note that in the attached sample, the Style is commented out and it is using the event handler way of achieving this functionality.
Please let me know if you have any other questions or concerns.
Sincerely,AndrewDeveloper Support IInfragistics Inc.www.infragistics.com/support
Alright, I managed to open the sample code in notepad++ and it looks legit.
Only two things:
1) when I put my original xaml, it affected every single pane currently on the screen, and any subsiquent pane added to the screen. In the codebehind you provided, you have to explicitly list the pane names.. is there any way to say "for every datagrid inside of the <grid> tag, toggle headers?"
2) what about controlling the style of one view from another. Meaning, if I were to put that checkbox inside of a seperate ribbon.xaml, and then put the ribbon inside of mainxaml, how could I use the checkbox from the ribbon to control the grid headers of the main viewmodel?
Hi, is there any chance that was done with a 2012 version of VS?
I'm using visual studio 2010 and I'm getting the error "This project is incompatible with the current version of visual studio"