SelectionBoxTemplate for RadGridView's GridViewComboBoxColumn not working??

1 Answer 64 Views
GridView
Pavel
Top achievements
Rank 1
Pavel asked on 13 Dec 2021, 03:19 PM

Is there a SelectionBoxTemplate for the RadGridView GridViewComboBoxColumn? I saw a template that was posted in the forum area from a while ago, but when I tried it in one of the latest Telerik libraries, it doesn't work?

 


 <telerik:GridViewComboBoxColumn Header="Sic Code"
                                                    IsComboBoxEditable="true"
                                                    DataMemberBinding = "{Binding SicCodeID}"
                                                    ItemsSource="{Binding Current.SicCodes, Source={StaticResource Lookups}}"
                                                    DisplayMemberPath="SicCodeValue"
                                                    SelectedValueMemberPath="SicCodeID"  
                                                    EditTriggers="CellClick"
                                                    LostFocus="GridViewComboBoxColumn_LostFocus"
                                                    TextSearch.TextPath="SicCodeValue"
                                                    Width="226">
                            <telerik:GridViewComboBoxColumn.EditorStyle>
                            <Style TargetType="telerik:RadComboBox">
                                <Setter Property="ClearSelectionButtonVisibility" Value="Visible" />
                                <Setter Property="ClearSelectionButtonContent" Value="Clear" />
                                <Setter Property="Foreground" Value ="Black" />
                                <Setter Property="DropDownWidth" Value ="480" />
                                <Setter Property="OpenDropDownOnFocus" Value="True"/>
                                <Setter Property="SelectionBoxTemplate">
                                    <Setter.Value>
                                        <DataTemplate >
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
                                                <TextBlock Text="{Binding SicCodeValue}" Width="70" />
                                                <TextBlock Text="{Binding SicCodeDescription}" Width="370"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="ItemTemplate">
                                    <Setter.Value>
                                        <DataTemplate >
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
                                                <TextBlock Text="{Binding SicCodeValue}" Width="70" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </telerik:GridViewComboBoxColumn.EditorStyle>
                    </telerik:GridViewComboBoxColumn>

 

Any idea's?

Paul

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 16 Dec 2021, 02:29 PM

Hello Pavel,

With the current implementation of the underlying RadComboBox control, used in the GridViewComboBoxColumn, applying a custom SelectionBoxTemplate will only be available when the IsComboBoxEditable property's value is set to False. However, if you want to customize the input area of an editable RadComboBox control, you should use the TextBoxStyle property. The Selection Box Template article in our documentation provides additional information on this topic.

I hope the provided information is of help to you.

Regards,
Stenly
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Pavel
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or