I have a radpanelbar that has one radpanelbaritem in it with an Itemtemplate. the itemtemplate has various control in it. I databind the radpanelbaritem to a list by setting the datacontext to the list. the binding for the controls in the template works. However I have a seperate combobox in the itemtemplate that needs to be bound to a seperate list. When I try binding it, everything goes thru without errors, but no items show in the combobox.
here is the Xaml:
<
telerikNavigation:RadPanelBar x:Name="MLSListing" ExpandMode="Multiple">
<telerikNavigation:RadPanelBarItem IsExpanded="True" ItemsSource="{Binding}">
<telerikNavigation:RadPanelBarItem.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,2,0,0">
<Image x:Name="RemMLSBtn" Source="Images/Cancel.png" Margin="0,0,10,0"></Image>
<TextBlock Text="Agent" Margin="0,3,0,0"></TextBlock>
<telerikInput:RadComboBox x:Name="cmbAgents" Width="100" Height="20" ItemsSource="{Binding}" DisplayMemberPath="FullName" IsEditable="True" IsReadOnly="True" SelectedIndex="0"></telerikInput:RadComboBox>
<TextBlock Text="MLS#" Margin="0,3,0,0"></TextBlock>
<TextBox Text="{Binding MLSNumber, Mode=TwoWay}" Width="70" Margin="5,0,10,0"/>
<TextBlock Text="Price" Margin="0,3,0,0"></TextBlock>
<TextBox x:Name="Price" Width="75" Text="{Binding Amount, Mode=TwoWay}"/>
<TextBlock Text="Date" Margin="0,3,0,0"></TextBlock>
<telerikInput:RadDatePicker Height="20" x:Name="OrgSaleDate" SelectedDate="{Binding Date, Mode=TwoWay}" Width="100" Margin="5,0,10,0"></telerikInput:RadDatePicker>
<TextBlock Text="MLS Status" Margin="0,3,0,0"></TextBlock>
<telerikInput:RadComboBox x:Name="cmbMLSStatus" Width="100" Height="22" IsEditable="True" SelectedIndex="-1" DisplayMemberPath="MLSStatus" ItemsSource="{Binding}" Margin="5,0,10,0"/>
<CheckBox x:Name="REOSale" Content="REO Sale" DataContext="{Binding REOSale, Mode=TwoWay}" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
</telerikNavigation:RadPanelBarItem.ItemTemplate>
<telerikNavigation:RadPanelBarItem.Header>
<StackPanel Orientation="Horizontal" >
<Image x:Name="AddMLSBtn" Source="Images/Addnew.png" Width="24" Height="24" />
<TextBlock Text="MLS Listings" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</telerikNavigation:RadPanelBarItem.Header>
</telerikNavigation:RadPanelBarItem>
</telerikNavigation:RadPanelBar>
Here is the codebehind that sets the datacontext of the radpanelbaritem and the combobox within the itemtemplate.
MLSListing.Items(0).dataContext = FRSingle.Listings
For i As Integer = 0 To MLSListing.Items.Count - 1
Dim RPI As RadPanelBarItem = MLSListing.ItemContainerGenerator.ContainerFromIndex(i)
Dim SP As StackPanel = RPI.ItemTemplate.LoadContent
Dim ComboList As List(Of RadComboBox) = SP.ChildrenOfType(Of RadComboBox)()
For isp As Integer = 0 To ComboList.Count - 1
If ComboList.Item(isp).Name = "cmbAgents" Then
ComboList.Item(isp).DataContext = Agents
End If
Next
Next
What am I doing wrong??