We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Rename "Select All" but only for one Instace

Thread ID:

Created:

Updated:

Platform:

Replies:

145543 Jun 27,2019 09:08 AM UTC Jul 2,2019 06:14 AM UTC WPF 5
loading
Tags: ComboBoxAdv
Thomas Beimel
Asked On June 27, 2019 09:08 AM UTC

Hi forum,

Is it possible to change the text "Select all" in a ComboBoxAdv?
But only for one instance not for all instances.

regards
Thomas

Jagadeesan Pichaimuthu [Syncfusion]
Replied On June 27, 2019 11:47 AM UTC

Hi Thomas, 
 
Thanks for using Syncfusion product. 
 
We have checked your requirement to change the text "Select all" in a ComboBoxAdv and you can able to achieve your requirement by customizing the style of the control. Here you can able to initialize the text to Content of the ComboBoxItemAdv as like below code snippet, 
 
<syncfusion:ComboBoxAdv x:Name="comboBoxAdv" Style="{DynamicResource ComboBoxAdvStyle1}" AllowMultiSelect="True" AllowSelectAll="True" HorizontalAlignment="Left" Height="34" Width="311" Margin="118,66,0,0" SelectionChanged="ComboBoxAdv_SelectionChanged"> 
    <ListBoxItem Content="item1"/> 
    <ListBoxItem Content="item2"/> 
    <ListBoxItem Content="item3"/> 
</syncfusion:ComboBoxAdv> 
 
<Style x:Key="ComboBoxAdvStyle1" TargetType="{x:Type syncfusion:ComboBoxAdv}">            
            <Setter Property="Template"> 
                <Setter.Value> 
                    <ControlTemplate TargetType="{x:Type syncfusion:ComboBoxAdv}"> 
 
……. 
<syncfusion:ComboBoxItemAdv x:Name="PART_SelectAll" Background="{Binding Background, ElementName=DropDownBorder}" Content="SelectAll item" Margin="0.2,0,0,0.5" Grid.Row="0"> 
    <syncfusion:ComboBoxItemAdv.Visibility> 
        <TemplateBinding Property="AllowSelectAll"> 
            <TemplateBinding.Converter> 
                <BooleanToVisibilityConverter/> 
            </TemplateBinding.Converter> 
        </TemplateBinding> 
    </syncfusion:ComboBoxItemAdv.Visibility> 
</syncfusion:ComboBoxItemAdv> 
 
………. 
 
 
Also please refer the below sample for your reference. 
 
 
 
Also you can refer how to create the EditTemplate to customize the appearance of the control. 
 
Let us know whether this helps also if you need any further assistance on this. 
 
Regards, 
Jagadeesan

Thomas Beimel
Replied On June 28, 2019 02:24 PM UTC

Hi Jagadeesan,

Ok, it works.
But is there an easier way than overwriting the entire template?

Regards
Thomas

Jagadeesan Pichaimuthu [Syncfusion]
Replied On July 1, 2019 12:53 PM UTC

Hi Thomas, 
 
Thanks for your update. 
 
We have checked your query and you can able to rename the SelectAll item, by using the below code snippet. Here you can get the SelectAllItem using reflection and change the content as like below code snippet, 
 
public MainWindow() 
{ 
    InitializeComponent(); 
    this.Loaded += OnLoaded; 
    this.comboBoxAdv.DropDownOpened += ComboBoxAdv_DropDownOpened; 
} 
 
private void ComboBoxAdv_DropDownOpened(object sender, EventArgs e) 
{ 
    FieldInfo infor = typeof(ComboBoxAdv).GetField("SelectAllItem", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); 
    var value = infor.GetValue(this.comboBoxAdv) as ComboBoxItemAdv; 
    value.Content = "Select All Item"; 
} 
 
 
 
 
Let us know whether this helps also if you need any further assistance on this. 
 
Regards, 
Jagadeesan 


Thomas Beimel
Replied On July 1, 2019 02:27 PM UTC

Hi Jagadeesan,

thank you. It works fine!

regards
Thomas

Jagadeesan Pichaimuthu [Syncfusion]
Replied On July 2, 2019 06:14 AM UTC

Hi Thomas, 
 
Thanks for your update. 
 
We are glad to know that the provided solution worked at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Jagadeesan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon