How to combind two dropdown list values into one dropdown list?

Hi All,

I refered some websites, they are combinding two dropdown list values into single, but i don't know .Net will support it or not? If any body knows it plz tell me how to achieve it??

EX: Go to Naukri.com and select Functional Area dropdown list there u can see main & sub category names in one dropdown list!!!

 

Thanks,

Aswath.

0
bhappy
12/30/2008 10:56:51 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

6 Replies
1011 Views

Similar Articles

[PageSpeed] 18
Get it on Google Play
Get it on Apple App Store

 hi just concatenate , or -

for ex:

Dropdownlist1.Datatextfield= maincategory & "," & Subcategory


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/30/2008 12:39:09 PM

Hi,

Thanks for reply,

Your solution is ok, but i need exactly like Naukri.com Is it possible in .Net server controls??? For html controls "opgroup" property is available, but i need for server controls??

 

Thanks,

Aswath.

0
bhappy
12/30/2008 12:51:49 PM

If you write sql query like

select main + ',' + sub from table

and if you bind the same to the drop down list you can get that.


Regards,
Ram Reddy Mekha, +91-994-840-4315
http://abhiramreddymekha.blogspot.com

Please Mark as Answer if the post helps you.
0
Ram
12/30/2008 12:54:14 PM

 this is the way they are used..., try this..

 wat does it means ie: optgroup ? Let me know clearly..


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/30/2008 12:54:35 PM

Yes u r correct, It is "optgroup". If u know any thing abt this plz tell me....

Thanks,

Aswath.

0
bhappy
12/30/2008 1:15:20 PM

Hi,

Based on your description, the issue is how to apply <optgroup> to the DropDownList control.

Usually, we achieve the goal by overriding the DropDownList control's RenderContents method.

The following articles cover this in detail. Please refer to it:

http://weblogs.asp.net/jeff/archive/2006/12/27/dropdownlist-with-optgroup.aspx

http://www.codeproject.com/KB/custom-controls/DropDownListOptionGroup.aspx

 


Forward Sun
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Forward
1/4/2009 12:19:32 PM
Reply: