Textwrapping in Combo box

4 posts, 0 answers
  1. kannan
    kannan avatar
    42 posts
    Member since:
    Sep 2010

    Posted 25 Oct 2010 Link to this post

         i am using RadCombo Box.i have to set  multiline with textwrapping property for combo box items ..if the size of the item greater then combo box width , the text have to wrap to the  next line.
     also i am using SelectionBoxTemplate inside






    ..But this is not working.. when i run the application SelectionBoxTemplate is null.....
    How  to set ? 
    This is my code;



















    <StackPanel HorizontalAlignment="Left" Orientation="Vertical" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Width="568">

























  2. Yana
    Yana avatar
    4603 posts

    Posted 28 Oct 2010 Link to this post

    Hello kannan,

    You should set ItemTemplate property of the combobox in order to wrap the text of its items. I've attached a simple example to demonstrate how to set both ItemTemplate and SelectionBoxTemplate, please download it and give it a try.

    All the best,
    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. black
    black avatar
    2 posts
    Member since:
    Feb 2014

    Posted 24 Mar 2014 in reply to Yana Link to this post

    Hi Yana,

             I also try to bind Key value pair to Rad Combo Box Control with Item Template.
     but Rad control display  value of item. but i want to show value instead of Key.

    Sample Code

    <telerik:RadComboBox MinHeight="34" MaxHeight="52"  HorizontalAlignment="Left" Name="CmbHired" TabIndex="7" Grid.Row="3" Grid.Column="1" ItemsSource="{Binding HiredProductCollection}"  SelectedValuePath="Id" SelectedValue="{Binding HiredProductGuid,Mode=TwoWay}" >
                                                                        <i:EventTrigger EventName="SelectionChanged">
                                                                            <i:InvokeCommandAction Command="{Binding HiredProductSelectionChangedCommand}" CommandParameter="{Binding SelectedItem, ElementName=CmbHired}"/>
                                                                            <Grid Width="172" >
                                                                                <TextBlock  Style="{x:Null}" Foreground="#2B3856" Padding="2" TextWrapping="Wrap" TextAlignment="Left" Width="172" Text="{Binding}" />

    But it's showing only values.
  4. black
    black avatar
    2 posts
    Member since:
    Feb 2014

    Posted 24 Mar 2014 in reply to black Link to this post

    i have solve the issues. i got solution form Telerik Demo URL.


    Solution is telerik:TextSearch.TextPath="Name"

    Thanks Yana
Back to Top