[Solved] - Can i Display an alternate name for the list selected value?

Hi,
I changed the combobox property to dropdownlist, and I want when select all combobox items , it will display an alternate signature of "* All *" instead "Alaska.Arizona....", can I do this?
Thanks you!

9 Replies

DV Duraimurugan Vedagiri Syncfusion Team May 18, 2020 01:58 PM UTC

Hi GridLock,

You can achieve this requirement by changing the Text of SfComboBox in SfComboBox.TextBox.TextChanged event handler. Please refer the below code snippet.

Code Snippet
sfComboBox1.TextBox.TextChanged += TextBox_TextChanged;  
private void TextBox_TextChanged(object sender, System.EventArgs e) 
{ 
    if (sfComboBox1.AllowSelectAll == true && sfComboBox1.CheckedItems.Count == sfComboBox1.DropDownListView.View.Items.Count) 
    { 
        sfComboBox1.Text = "* All *"; 
    } 
} 

Regards,
Durai


TG The GridLock May 18, 2020 02:31 PM UTC

Thanks durai,
But if I want to get name the selected columns then I will probably have to loop them again. I mean they will be obscured, but I can still access them by calling combobox.text


DV Duraimurugan Vedagiri Syncfusion Team May 19, 2020 11:19 AM UTC

Hi GridLock,

Thanks for your update.

If want selected items that, you can get with help of SfComboBox.SelectedItems property.

Please let us know if the solution helps. If not, kindly brief your requirement, it would be helpful for us to provide the solution as soon as possible.

Regards,
Durai


TG The GridLock May 19, 2020 04:50 PM UTC

Thanks Durai, great!



DV Duraimurugan Vedagiri Syncfusion Team May 20, 2020 04:54 AM UTC

Hi GridLock,

Thanks for your update.

Please let us know if you need any further assistance.

Regards,
Durai


TG The GridLock May 20, 2020 06:07 AM UTC

Hi Durai,
why when set allowselectall=true , .selecteditems or checkeditems return dulicate values but .DropDownListView.View.Items.Count return unique?




DV Duraimurugan Vedagiri Syncfusion Team May 21, 2020 03:33 PM UTC

Hi GridLock,

Thanks for your update.

We have analyzed the reported issue "SelectedItems or CheckedItems return duplicate values", but we are unable to reproduced at our end.

Here the sample and video that works as expected.

Sample: https://www.syncfusion.com/downloads/support/forum/154319/ze/SfComboBoxSample1627031973.zip  

Video: https://www.syncfusion.com/downloads/support/forum/154319/ze/SfComboBoxScr1547936102.zip  

If our replication procedure is different from you requirement, kindly modify our attached sample into issue reproducible. It would be helpful for us to proceed further.

Regards,
Durai



TG The GridLock May 22, 2020 02:48 AM UTC

hi, Durai
Thanks for the sample file, I will check it soon.


DV Duraimurugan Vedagiri Syncfusion Team May 25, 2020 07:49 AM UTC

Hi GridLock,

Thanks for your update.

We are looking forward to your confirmation. Please let us know if you need any further assistance.

Regards,
Durai


Loader.
Up arrow icon