Advertisements
RSS

Tag Archives: DropDownList

C#:Using Dictionary as DropDownList Data Source

I have IDictionary Object called ListOptions. To use it as the data source for an ASP.NET DropDownList called objDropDownList:

 

objDropDownList.DataSource = ListOptions;

objDropDownList.DataTextField = “Value”;

          objDropDownList.DataValueField  = “Key”;

          objDropDownList.DataBind(); 

 

 

 

Advertisements
 
Leave a comment

Posted by on March 31, 2009 in Programming

 

Tags: , , , , , , , , , , , , , ,

 
%d bloggers like this: