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

Remove the single selection tag template

5 Answers 186 Views
MultiColumnComboBox
This is a migrated thread and some comments may be shown as answers.
Usman
Top achievements
Rank 1
Usman asked on 09 Apr 2020, 05:05 PM

Hi Team,

I would like to disabled the selected item template that we display when a single item is selected and behave it like combo box where clear button (x) is placed at the end.

Thanks

5 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 14 Apr 2020, 10:05 AM

Hi Usman,

To achieve this behavior you will need to extract and edit the default template of the control. You can take a look at the Editing Control Templates help article which describes how you can get the default template of the controls. More specifically, you will have to modify the template of the SearchAutoCompleteBox inside the control. You can modify this element template to add a button at the end of the search part.

To remove the close button inside the selected item, you can set the SelectionBoxesVisibility property of the RadMultiColumnComboBox to Collapsed.

<telerik:RadMultiColumnComboBox   SelectionBoxesVisibility="Collapsed" SelectionMode="Single"> . . . 

Regards,
Dinko
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Louay
Top achievements
Rank 1
answered on 28 Jun 2020, 05:07 PM
I tried the SelectionBoxesVisibility="Collapsed" , on startup, if I select the first item on the list it doesnt show. But if I select any other item it will show.
0
Dinko | Tech Support Engineer
Telerik team
answered on 29 Jun 2020, 01:03 PM

Hello Louay,

This behavior could be observed when the SelectionBoxesVisibility is set to Collapsed/Hidden and AutoCompleteMode is Search/Suggest. It is already logged in our Feedback Portal, where you can track its progress. 

As a workaround, you can try using the following implicit style, which targets the SearchAutoCompleteBoxItem element. In the implicit Style, you can override the Template and place inside TextBlock. The Text property of the TextBlock will be bind to the property of the selected item.

<Style TargetType="telerik:SearchAutoCompleteBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <TextBlock Text="{Binding "Your Property here. In this case, can be Name as DisplayMemberPath" }"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Regards,
Dinko
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Louay
Top achievements
Rank 1
answered on 29 Jun 2020, 05:50 PM

Thanks Dinko,

If I use implicit style? is there a way to use the DisplayMemeberPath in the Binding? Otherwise I have to use a common filed name in all my MultiComboBoxes.

 

0
Louay
Top achievements
Rank 1
answered on 29 Jun 2020, 07:06 PM

Hello Dinko,

Issue resolve, I used ContentPresenter instead of TextBlock. And now the DisplayMemberPath is working. 

<Style TargetType="telerik:SearchAutoCompleteBoxItem">
       <Setter Property="Template">
           <Setter.Value>
               <ControlTemplate TargetType="telerik:SearchAutoCompleteBoxItem">
                   <ContentPresenter/>
 
               </ControlTemplate>
           </Setter.Value>
       </Setter>
   </Style>
Tags
MultiColumnComboBox
Asked by
Usman
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Louay
Top achievements
Rank 1
Share this question
or