Not checking multi selection on the list when selection programatically

Hi,

I am opening a for with a SFCombobox with multiselection option, ans I am setting on it values stored previously on a DB. On the text part of the combo I can see the checkeditems I just added by code (SfcbCatalogoRegimenes.CheckedItems.Add(objDatoSF)), but if I open the dropdown list those items are not checked, I need to press the Cancel button and then next time I open the dropdown list appear checked now.

I suppose this should be automatically (when you set by code a checked item) the item must appear on the text part and be checked, but it is not happening that way, just when you click Cancel button the first time.

Any ideas?

Best regards

Julian Hevia Alvarez

5 Replies

MG Mohanraj Gunasekaran Syncfusion Team August 9, 2018 12:25 PM UTC

 
Thanks for your interest in Syncfusion product. 
 
As per your code, you are trying to add the new objects to the CheckedItems collections. This is not a recommended approach. You need to add the objects from underlying datasource. Please refer to below code example and the sample. 
 
Code example 
List<USState> list = GetData(); 
this.sfComboBox1.DataSource = list; 
this.sfComboBox1.CheckedItems.Add(list[0]); 
this.sfComboBox1.CheckedItems.Add(list[3]); 
this.sfComboBox1.CheckedItems.Add(list[4]); 
 
Screenshot 
 
 
Sample link: SfComboBox 
 
Moreover, we confirmed that issue with “The items in the dropdown is checked while clicking on the cancel button when adding new objects than underlying objects” as defect and it will be available in our upcoming release 2018 Volume 2 – SP2 which is expected to be rolled out tentatively by the end of August 2018. 
 
Regards, 
Mohanraj G 



JH Julian Hevia Alvarez August 14, 2018 03:42 AM UTC

Thanks a lot for your reply. I will wait for the release of the new version.

Regards

Julian Hevia


MG Mohanraj Gunasekaran Syncfusion Team August 14, 2018 09:00 AM UTC

Hi Julian, 
 
Thanks for your update. 
 
We will update once 2018 Volume 2 – SP2 is released. 
 
Regards, 
Mohanraj G 



RR Rija Rabe replied to Julian Hevia Alvarez December 3, 2019 05:55 AM UTC

Hi,

I am opening a for with a SFCombobox with multiselection option, ans I am setting on it values stored previously on a DB. On the text part of the combo I can see the checkeditems I just added by code (SfcbCatalogoRegimenes.CheckedItems.Add(objDatoSF)), but if I open the dropdown list those items are not checked, I need to press the Cancel button and then next time I open the dropdown list appear checked now.

I suppose this should be automatically (when you set by code a checked item) the item must appear on the text part and be checked, but it is not happening that way, just when you click Cancel button the first time.

Any ideas?

Best regards

Julian Hevia Alvarez

Hello,
For my part, I am doing like this but still no appearance.
The object seems to be the POCO class and the checkbox wont display correctly. I looped over the CheckedItems collection and the content are the name of the POCO object instead of the content of it. 

Please see below the screenshot.








SM Suriyaprabha Murugabaskaran Syncfusion Team December 4, 2019 12:11 PM UTC

Hi Rija, 

Thanks for your updates. 

Query : I looped over the CheckedItems collection and the content are the name of the POCO object instead of the content of it. 

We have analyzed your reported query in our sample and it seems like the list items shows it’s content correctly. Please refer the below screenshot. 

 

Based on your screenshot, we have understood that the list items are from ActivitesStr class. So it would be helpful if you provide the information about how you customize the ActivitesStr class in order to get the list items, else please share us the simple sample to reproduce the reported behavior. It will be helpful for us to analyze and provide the solution at the earliest. 

Please revert us if you have any other concerns. 

Regards, 
Suriyaprabha M. 


Loader.
Up arrow icon