Using Label and DescriptionViewer with RadComboBox

4 posts, 0 answers
  1. GEB
    GEB avatar
    228 posts
    Member since:
    Dec 2008

    Posted 13 Mar 2010 Link to this post

    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> 
     
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 18 Mar 2010 Link to this post

    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.
  3. GEB
    GEB avatar
    228 posts
    Member since:
    Dec 2008

    Posted 18 Mar 2010 Link to this post

    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.
  4. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 19 Mar 2010 Link to this post

    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.
Back to Top