Asked by:
DropDown Item Selected..

Question
-
I have a requirement where there are 5items in a drop down--India,Aus,Uk,Pak and Others..So when i select others option in drop down i should be able to navigate to a text box on the design form and when i enter the text and click submit the text should be added to the drop down.Wednesday, October 31, 2012 6:14 AM
All replies
-
Hi Reddy,
Welcome to the MSND Forum.
What is your application type? Winform? WPF? Asp.net?
And what program language do you use?
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Thursday, November 1, 2012 8:48 AM -
Hi Reddy,
1) If you are retrieving the dropdown list data from a DataBase Table then it is good and easy for you to store textbox entered value in database Table(save textbox value when user click submit button)
2) Again load/call the Dropdown list code.
Now you can see new textbox entered value in dropdownlist.
PS.Shakeer Hussain
Thursday, November 1, 2012 12:34 PM -
It is Winform and language is c#
Friday, November 2, 2012 4:39 AM -
Nope...The problem is i am adding items within the code and not retrieving it from Sql...Like
Dropdownlist1.items.add("Abc");
Dropdownlist1.items.add("def");
Dropdownlist1.items.add("ghi");
Dropdownlist1.items.add("Others");
These items get added to the drop down.Now when i click on the others dropdown it should allow me to add data in a text box and when i click submit the data in the textbox should be added to dropdown.How can i do this task??
Friday, November 2, 2012 4:44 AM -
Hi Reddy,
Winform doesn't contains a control named Dropdownlist, it should be ComboBox contorl.
when i click on the others dropdown it should allow me to add data in a text box
You can add the data to textbox in ComboBox.SelectedIndexChanged Event handler.
when i click submit the data in the textbox should be added to dropdown.
You can add the data to combobox in Button Click event hander.
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
Friday, November 2, 2012 6:04 AM -
Can u show it in the code above how can i complete this and i am using a visual webpart where i have a dropdown list option.Friday, November 2, 2012 6:30 AM
-
Can u show it in the code above how can i complete this and i am using a visual webpart where i have a dropdown list option.
Hi Reddy,
Are you creating a Visual Web Part project? Base on my knowledge, it a SharePoint project.
If so, I'm afraid this is not supported in Winform forum. Winform is a smart client windows-based applications. For more details about Windows Forms, see http://msdn.microsoft.com/en-us/library/8bxxy49h(v=vs.110).aspx
For sharepoint development issue, please create a new thread in SharePoint Products and Technologies forum.
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
Friday, November 2, 2012 9:05 AM