How to change DataSource of combobox in winform

Hi, I have a issue when uesd winform for grasshopper component. I have two combobox. I write a code doing somethings :
1- When i have a action " SelectedIndexChanged" in combobox 1, I want DataSource of combobox2 reload, but it not run.
2 After, when I close from, and i call winfrom again DataSource of combobox2 has reloaded.
How i can fix it. Thanks.
WindTCVN.rar (28.8 KB)

Hi @ngthanhlong82, the rar file seems to be defective. Can you post it again eg. as zip file ?


Hi @clement . This is my file. (33.0 KB)

Hi @ngthanhlong82, if you re-set the DataSource like so:

_frmwind.CbQuanHuyen.DataSource = null;
_frmwind.CbQuanHuyen.DataSource = dsdistrictcity1;

does it work then ? I remember when a BindingList is used a DataSource, a comboBox should update automatically when the BindingList content changed.


Thanks @clement . I will try it.