Quantcast
Viewing all articles
Browse latest Browse all 12583

Dynamic checkboxlist generation, checking it and retrieve it-- windows forms

Hi,

This is windows forms application.

     I have a Dictionary<int, string> , from that I need to generate the checkbox list. So i did the following code

BindingSource bindingSource =newBindingSource();
            bindingSource.DataSource= configuredResourceGroups;
            _chkResourceGroupList.DataSource= bindingSource;
            _chkResourceGroupList.DisplayMember="Value";
            _chkResourceGroupList.ValueMember="Key";

It works correctly. Then now I have a list<int> which have some values that match with the int in dictionary, so I need to check those checkboxes.

Ex: if checkbox list has

1  -a

3  -b

56 -c

2  -d

and i have the list<int> with 1 and 2. I need to check the first and last checkbox in list. Also I need to loop through the checkboxlist and get the checked box keys.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>