Want to subscribe? What is the recommended way to have a listbox dynamically update its contents in reaction to data source changes? In the example above Model. When the data source changes in the background I was expecting the listbox to update automatically but it does not.
Is there a way to make this happen? Hi Tom,. Thank you for contacting Syncfusion support. Query : What is the recommended way to have a listbox dynamically update its contents in reaction to data source changes? We have checked your reported query, we suggest you to use Observable collection to the datasource property to update the listbox dynamically during datasource changes. In the button click event we have added the items in listbox datasource.
When you set DataSource to null , DisplayMember is set to an empty string "". Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. List Control. Data Source Property Reference Is this page helpful? Please rate your experience Yes No. ArgumentException" exception. From the above, we can see another workaround is calling the refresh method of ListBox after you set the DataSource property to false.
Best Regards,. Bruce Zhou. Use a BindingList instead of a list when you plan to databind to the data in the list. The bindinglist is setup for databinding. Hi Ken, thanks for the reply. I played around with the listbox a bit more and found that the listbox does not display properly when; selectionmode is set to none, a list or even bindinglist is set as the datasource, the datasource is later set to nothing.
In the situation I described above I wanted to sort my list by passing a delegate of Comparison Of T which I can't seem to do with a bindinglist unless I am missing something. Thanks for your reply. I will try this and use this workaround. Thanks for this. The problem appears to continue, even now, but your second workaround does solve the problem! Maybe this soluction has not the better performance, but after many tries and a few hours it was what it worked for me: This line was executed on the form constructor:.
Ask a question. Quick access.
0コメント