Last post Mar 26, 2009 04:04 PM by budugu
Mar 26, 2009 02:25 PM|RITE|LINK
I am new to ASP.Net programming.Please anyone helps me to add optgroup option to dropdown list, The dropdown source is getting from sqlserver.
Mar 26, 2009 03:15 PM|crazy123321|LINK
You haven't given enough information about the nature of your problem. I'm assuming you have already got the data but do not know how to apply it to the dropdownlist, if this is the case then the simplest method would be to apply it to the datasource attribute
of the dropdownlist like so:
yourdropdownlistid.DataSource = optgroup;
You can also use the DataTextField and DataValueField attributes to specify what field is assigned to the text and value attributes like so:
yourdropdownlistid.DataTextField = "yourfieldnameA";
yourdropdownlistid.DataValueField = "yourfieldnameB";
Mar 26, 2009 03:56 PM|RITE|LINK
Thanks , I need group the source by category and bind to dropdown List.
For example the drop down list displays like
Mar 26, 2009 04:04 PM|budugu|LINK
OptGroup is not possible with normal asp.net DropDownList. Check these custom controls..