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

GridViewComboBoxColumn with IsComboBoxEditable="True" and EditorStyle.

1 Answer 173 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ole
Top achievements
Rank 1
Ole asked on 07 Oct 2011, 02:47 PM
Hi,

I am trying to have a an autocomplete combobox with an Editorstyle at the sametime.

The autocomplete works without the Editorstyle, but putting the editorstyle in like this, will stop the autocomplete from working.

Any idears ?.

Best

Ole



<
telerik:GridViewComboBoxColumn UniqueName="cmbActionBy"  IsComboBoxEditable="True" Header="Action by" DataMemberBinding="{Binding Path=tblContact}"  telerik:TextSearch.TextPath="ShortName" DisplayMemberPath="ShortName" Width="80" SortMemberPath="tblContact.ShortName" EditorStyle="{Binding Source={StaticResource MyStyle}}">

 

 

<Style x:Key="MyStyle" TargetType="telerik:RadComboBox">
 
           <Setter Property="ItemTemplate">
 
               <Setter.Value>
 
                   <DataTemplate>
 
                       <StackPanel Orientation="Vertical"   VerticalAlignment="Center">
                           <TextBlock Text="{Binding Path=Name}" TextAlignment="Left" HorizontalAlignment="Left" />
                           <TextBlock Text="{Binding Path=ShortName}" TextAlignment="Right" HorizontalAlignment="Right" Margin="5,0,0,0"/>
                       </StackPanel>
 
                   </DataTemplate>
 
               </Setter.Value>
 
           </Setter>
 
       </Style>

1 Answer, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 07 Oct 2011, 02:52 PM
Hi Ole,

You could try to set the TextPath attached property of RadComboBox. For example:

<Style x:Key="MyStyle" TargetType="telerik:RadComboBox">
           <Setter Property="ItemTemplate">
               <Setter.Value>
                   <DataTemplate>
                       <StackPanel Orientation="Vertical"   VerticalAlignment="Center">
                           <TextBlock Text="{Binding Path=Name}" TextAlignment="Left" HorizontalAlignment="Left" />
                           <TextBlock Text="{Binding Path=ShortName}" TextAlignment="Right" HorizontalAlignment="Right" Margin="5,0,0,0"/>
                       </StackPanel>
                   </DataTemplate>
               </Setter.Value>
           </Setter>
 
           <Setter Property="telerik:TextSearch.TextPath" Value="Name" />
</Style>
 
Let me know whether this approach works for you.

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Ole
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or