This is a migrated thread and some comments may be shown as answers.

Pinning rad pane resets databound comboboxes

1 Answer 53 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 02 Apr 2013, 08:52 AM
I have a number of databound comboboxes in a rad pane that load fine.

I have an issue that when I try and pin the pane all the comboboxes reset and I get

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='comboItems'

a number of times.

Where combo items is defined as

<DataTemplate x:Key="DrillComboTemplate" >
                    <ComboBox SelectedValue="{Binding Value}" Width="{Binding Width}" HorizontalContentAlignment="{Binding Alignment}" ItemsSource="{DynamicResource comboItems}" />
                </DataTemplate>

Thanks

Andy

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 05 Apr 2013, 11:27 AM
Hello,

When a Pane is pinned/unpinned its content is moved to a popup and the DataContext is reset which is causing the selection of the ComboBoxes to be lost.

All you need to do to solve this issue is to set the DataContext of the Pane. The next code snippet shows the described approach:
<Window.Resources>
    <local:ViewModel x:Key="ViewModel"/>
</Window.Resources>
     
<Grid DataContext="{StaticResource ViewModel}" x:Name="LayoutGrid">
    <telerik:RadDocking>
        <telerik:RadSplitContainer>
            <telerik:RadPaneGroup>
                <telerik:RadPane Header="Pane 1" DataContext="{Binding ElementName=LayoutGrid, Path=DataContext}">
                    <StackPanel>
                        <ComboBox ItemsSource="{Binding Items}"
                                    DisplayMemberPath="Name"
                                    SelectedIndex="0"/>
                    </StackPanel>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking>
</Grid>

Hope this is helpful.

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Andrew
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or