Using version 20091.2056; writing in C#.
I'm using a ContentPane and for some reason if I try to add it via the designer, I end up with a control that has the header controls grayed out meaning I can't unpin or close the control.
If I create the components via code, I don't have the issue but I run into other time-consuming situations trying to do the entire layout via code. Would prefer not to have some of each either. Would like to lay it out in the designer.
Below are the controls up to and including the ContentPane. Any ideas what I'm doing wrong or if this is a bug and how to work around it?
Also, I really don't want the close button to be functional so would like to know how to access both to enable/disable via source. How to do that?
Thanks.
Allen
<Grid Name="layoutRoot" Loaded ="Grid_Loaded" >
<Grid.ColumnDefinitions > <ColumnDefinition Width ="Auto" />
...
allenovereem said: Below are the controls up to and including the ContentPane. Any ideas what I'm doing wrong or if this is a bug and how to work around it?
allenovereem said: Also, I really don't want the close button to be functional so would like to know how to access both to enable/disable via source. How to do that?
Thanks Andrew. That explains why it works in the code too. I was adding them to the pane in the code but didn't connect that I needed the pane in the designer since I didn't have the component to select in the toolbox. It is much like adding columns, etc. to the grid. The "new to WPF" fog clears just a little!
Now I can collapse the pane but can't expand it again. Any ideas?
I had the allowclose in there and it does cause the button to be grayed out as you say. I will use your idea for generating the custom header later on. Thanks again!
<p>Yes, I guess I did mean pinned and unpinned. When I click on the pin with the panel expanded (visible), it collapses into the wall as expected and the tab appears on the left margin. However, when I click the tab, the panel does not expand (does not become visible). I tried using the same idea as you gave me for the other issue and added a contentpane.content wrapper for the stackpanel but that did not help.</p><p>Here is the xaml:</p><p><UserControl x:Class="NS_MyScheduleTab.UC_MyScheduleTab" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:igDock="http://infragistics.com/DockManager" xmlns:igEditors="http://infragistics.com/Editors" xmlns:igWindows="http://infragistics.com/Windows" xmlns:igDP="http://infragistics.com/DataPresenter" mc:Ignorable="d" Height="800" Width="1280"> <Grid Name="layoutRoot" Loaded="Grid_Loaded" > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <igDock:XamDockManager Name="xamDockManager1" Grid.Column="0" > <igDock:XamDockManager.Panes> <igDock:SplitPane HorizontalAlignment="Left" Name="splitPaneLeft" VerticalAlignment="Top" Height="Auto" Width="Auto"> <igDock:ContentPane AllowClose="False" Header="Filters" HorizontalAlignment="Left" Name="contentPaneLeft" VerticalAlignment="Top"> <igDock:ContentPane.Content> <StackPanel Name="stackPanelLeft" HorizontalAlignment="Stretch" VerticalAlignment="Top" > <Label Grid.Row="1" Grid.Column="0" Content="Selected Date / Range:" Name="lblCalendar"/> <igEditors:XamMonthCalendar Name="xamMonthCalendar1" Width="280" DayOfWeekHeaderFormat="TwoCharacters" SelectedDatesChanged="xamMonthCalendar1_SelectedDatesChanged" BorderThickness="1" /> <Separator Height="5" Name="separator1" HorizontalAlignment="Stretch" Margin="0,10" /> <Label Content="Selected Date:" Name="lblSelectedDateRange" /> <TextBox Height="20" MinWidth="75" MaxWidth="200" Name="txtSelectedDateRange" HorizontalAlignment="Center"/> <Separator Height="5" Name="separator2" HorizontalAlignment="Stretch" Margin="0,10"/> <Label Content="Select Provider(s):" Name="lblSelectProvider"/> <igDP:XamDataGrid Name="xamDataGrid3" Margin="20,0" MinWidth="200" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SelectedItemsChanged="xamDataGrid3_SelectedItemsChanged" > <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="ProviderName" Label="ProviderName" > </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid> </StackPanel> </igDock:ContentPane.Content> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager> <igWindows:XamTabControl Name="xamTabControl1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1" Grid.ColumnSpan="3"> <TabItem Header="Provider Appointments" Name="tiWorksheetInfo" HorizontalAlignment="Stretch"> <Grid> <igDP:XamDataGrid HorizontalAlignment="Stretch" Name="xamDataGrid1" VerticalAlignment="Stretch" RecordActivated="xamDataGrid1_RecordActivated" SelectedItemsChanging="xamDataGrid1_SelectedItemsChanging" SelectedItemsChanged="xamDataGrid1_SelectedItemsChanged"/> </Grid> </TabItem> <TabItem Header="Selected Patient Appointments" Name="tiPatientInfo" HorizontalAlignment="Stretch"> <Grid> <igDP:XamDataGrid HorizontalAlignment="Stretch" Name="xamDataGrid2" VerticalAlignment="Bottom" /> </Grid> </TabItem> </igWindows:XamTabControl> </Grid></UserControl></p>
<p>Thanks.
</p>
Thanks for the help! Most embarrassing!
I had tried to have the dockmanager contain the tab control but I ran into issues because I could not get it to display properly without adding the tab control to another content pane which I didn't want to do since I didn't want a header etc. for that subset of components.
I couldn't seem to find a container component that worked to hold the tab control but that didn't also give me a header for free.
It works beautifully now and I assume it is also due to the addition of the pane to the dockmanager from your first suggestion.
Thanks again Andrew!
You have the xamDockManager in a Grid where the ColumnDefinition it is associated with is set to Auto - i.e. the ColumnDefinition will only be as wide as the children in that column need based on their content. Well when you unpin the ContentPane the XamDockManager gets smaller - actually only as wide as the UnpinnedTabArea. The UnpinnedTabFlyout is shown as a child of the DockManagerPanel but since it has a Width of 0 - because there is nothing else in the xamDockManager content area and you have it in a container that is only making it as wide as it needs to be you don't actually see the flyout because it is clipped by the ancestor elements. Typically one makes the xamDockManager the content of say the UserControl/Window and then puts other things into the Content of the xamDockManager. So for example you might get rid of the ColumnDefinitions for the layoutRoot and move the XamTabControl into the XamDockManager. e.g.
<Grid Name="layoutRoot" Loaded="Grid_Loaded" > <igDock:XamDockManager Name="xamDockManager1" Grid.Column="0" > <igDock:XamDockManager.Panes> <igDock:SplitPane HorizontalAlignment="Left" Name="splitPaneLeft"> <igDock:ContentPane AllowClose="False" Header="Filters" Name="contentPaneLeft"> <igDock:ContentPane.Content> <StackPanel Name="stackPanelLeft"> <Label Grid.Row="1" Grid.Column="0" Content="Selected Date / Range:" Name="lblCalendar"/> <igEditors:XamMonthCalendar Name="xamMonthCalendar1" Width="280" DayOfWeekHeaderFormat="TwoCharacters" SelectedDatesChanged="xamMonthCalendar1_SelectedDatesChanged" BorderThickness="1" /> <Separator Height="5" Name="separator1" HorizontalAlignment="Stretch" Margin="0,10" /> <Label Content="Selected Date:" Name="lblSelectedDateRange" /> <TextBox Height="20" MinWidth="75" MaxWidth="200" Name="txtSelectedDateRange" HorizontalAlignment="Center"/> <Separator Height="5" Name="separator2" HorizontalAlignment="Stretch" Margin="0,10"/> <Label Content="Select Provider(s):" Name="lblSelectProvider"/> <igDP:XamDataGrid Name="xamDataGrid3" Margin="20,0" MinWidth="200" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SelectedItemsChanged="xamDataGrid3_SelectedItemsChanged" > <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="ProviderName" Label="ProviderName" > </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid> </StackPanel> </igDock:ContentPane.Content> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> <igWindows:XamTabControl Name="xamTabControl1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1" Grid.ColumnSpan="3"> <TabItem Header="Provider Appointments" Name="tiWorksheetInfo" HorizontalAlignment="Stretch"> <Grid> <igDP:XamDataGrid HorizontalAlignment="Stretch" Name="xamDataGrid1" VerticalAlignment="Stretch" RecordActivated="xamDataGrid1_RecordActivated" SelectedItemsChanging="xamDataGrid1_SelectedItemsChanging" SelectedItemsChanged="xamDataGrid1_SelectedItemsChanged"/> </Grid> </TabItem> <TabItem Header="Selected Patient Appointments" Name="tiPatientInfo" HorizontalAlignment="Stretch"> <Grid> <igDP:XamDataGrid HorizontalAlignment="Stretch" Name="xamDataGrid2" VerticalAlignment="Bottom" /> </Grid> </TabItem> </igWindows:XamTabControl> </igDock:XamDockManager> </Grid>
BTW you should also avoid setting the Vertical|HorizontalAlignment of the SplitPane and ContentPane or your going to get some odd results in how the elements are arranged. Typically one wants them to stretch to use the available area so the default value of Stretch makes the most sense.