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

    Hi,
         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

    telerik

     

     

    :RadWindow.Resources

     

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

     

     

     

    <telerik:RadComboBox.ItemsPanel>

     

     

     

     

     

     

    <ItemsPanelTemplate>

     

     

     

     

     

     

     

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

     

     

     

     

     

     

    </StackPanel>

     

     

     

     

     

     

    </ItemsPanelTemplate>

     

     

     

     

     

     

    </telerik:RadComboBox.ItemsPanel>

     

     

     

  2. Yana
    Admin
    Yana avatar
    4554 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,
    Yana
    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. DevCraft banner
  4. 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:Interaction.Triggers>
                                                                        <i:EventTrigger EventName="SelectionChanged">
                                                                            <i:InvokeCommandAction Command="{Binding HiredProductSelectionChangedCommand}" CommandParameter="{Binding SelectedItem, ElementName=CmbHired}"/>
                                                                        </i:EventTrigger>
                                                                    </i:Interaction.Triggers>
                                                                    <telerik:RadComboBox.ItemTemplate>
                                                                        <DataTemplate>
                                                                            <Grid Width="172" >
                                                                                <TextBlock  Style="{x:Null}" Foreground="#2B3856" Padding="2" TextWrapping="Wrap" TextAlignment="Left" Width="172" Text="{Binding}" />
                                                                            </Grid>
                                                                        </DataTemplate>
                                                                    </telerik:RadComboBox.ItemTemplate>
                                                                </telerik:RadComboBox>

    But it's showing only values.
  5. 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.

    http://demos.telerik.com/silverlight/#ComboBox/DataBinding

    Solution is telerik:TextSearch.TextPath="Name"

    Thanks Yana
Back to Top