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

Using Label and DescriptionViewer with RadComboBox

3 Answers 43 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
GEB
Top achievements
Rank 1
GEB asked on 13 Mar 2010, 06:53 PM
I am successfully using the Label control, bound to most other controls.  However, I have yet to be able to get the Label control to work with RadComboBox.  I am binding the ComboBox with an IEnumerable collection using RIA Services (this works fine).  I set the DisplayMemberPath so that the appropriate values are displayed in the ComboBox. All of this works great.

However, when I add a Label control, and bind it to the ComboBox, my label is not displayed.  I am using the Target property, rather than the Content property so that I can use the metadata associated with the data.  BTW, the same goes for the DescriptionViewer control (doesn't work the way I have it with the RadComboBox).  Here is a sample of my XAML:

        <dat:Label Grid.Row="1" Grid.Column="0" Target="{Binding ElementName=SystemComboBox}" PropertyPath="SystemName" /> 
        <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">  
            <telerikInput:RadComboBox x:Name="SystemComboBox" Width="300"   
                     HorizontalAlignment="Left" VerticalAlignment="Center" 
                     ItemsSource="{Binding Systems}" 
                     DisplayMemberPath="SystemName" 
                     IsReadOnly="True" IsEditable="True" /> 
            <dat:DescriptionViewer Target="{Binding ElementName=SystemComboBox}" PropertyPath="SystemName" /> 
        </StackPanel> 
 

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 18 Mar 2010, 02:52 PM
Hello GEB,

Thank you for contacting us.

The Target property of the Label works as expected at our side. Attached I am sending you a sample project for reference.
Hope it helps.

If you still experience difficulties please feel free to contact us again.

Greetings,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
GEB
Top achievements
Rank 1
answered on 18 Mar 2010, 10:33 PM
I have modified your sample to be more like my application, and have been able to demonstrate the issue.  In order to attach the project, I will open a Support Ticket.
0
Konstantina
Telerik team
answered on 19 Mar 2010, 03:51 PM
Hi Gary,

Thank you for the provided project.

To make it work we added a DataContext to the Parent control (in our case the StackPanel). In that way the bindings get valid and the Label is able to "find" the metadata of the property to which it is bound.
Probably, the case is that the MS controls are optimized and there is no need to write special code to make the Target property work correctly.
Please find the attached project.

If you have any other questions please feel free to contact us again.

Kind regards,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
GEB
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
GEB
Top achievements
Rank 1
Share this question
or