开发者

How to make optgroups using ASP.NET WebForms

I'm working with ASP开发者_运维知识库.NET. I want to make optgroups in a DropDownList using data binding to data from SQL Server. For example, I've got 2 tables — one for country & another for states. In my drop down list in ASP.NET, I want to bind to the data in these 2 tables. The country table should become optgroup, & states should go under that.

-India-
  kerala
  tamilnadu
-america-
  newyork


Actually you can solve this with a hack. Override RenderContents of the DropDownlist like this http://weblogs.asp.net/jeff/archive/2006/12/27/dropdownlist-with-optgroup.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜