Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

change combobox selectedItem

$
0
0

i have created a simple user control with a combobox and put one instance of that user control in main form.

i have no problem with assigning it a data source, but i'm not receiving the SelectedItem or SelectedValue.

in user control i wrote -

public object ComboSelectedItem

{

get{return combobox.SelectedItem;}

set{combobox.SelectedItem=value;}

}

From main form i'm accessing the control with-

userControl1.ComboSelectedItem=2

but the combo box selected item not changing to 2

what is the problem? how can i change the value of the combobox?

thanks in advance.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



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