how to combine dropdown and assing to a string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • umapathi
    New Member
    • Aug 2010
    • 1

    how to combine dropdown and assing to a string

    hi,
    I have 3 dropdownlist for displaying the day,month and year.
    I need combine those dropdown's selected items .
    so,i need the answer to
    1.how to combine the those 3 values
    2.how to assign to a string
  • Christian Binder
    Recognized Expert New Member
    • Jan 2008
    • 218

    #2
    You can take use of ComboBox' member SelectedText or you use SelectedItem.To String() to get a string.
    After that you can concatenate these strings with a plus-sign.
    E.g.
    Code:
    string s1 = comboBox1.SelectedText;
    //or string s1 = comboBox1.SelectedItem.ToString();
    string s2 = comboBox2.SelectedText;
    string result = s1 + s2; // or s1 + " " + s2

    Comment

    Working...