Mohd Malaka Weblog

About anything….

  • Welcome


    Welcome to my Weblog. Here I post about anything, mainly about programming. Enjoy

  • Archives

  • Flickr Photos

    Dublin





    Dublin Buildings

    Dublin

    More Photos
  •  

    March 2009
    M T W T F S S
    « Feb   May »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  
  • free counters

C#:Using Dictionary as DropDownList Data Source

Posted by malakablog on March 31, 2009

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(); 

 

 

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>