Mohd Malaka Weblog

About anything….

  • Welcome


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

  • Archives

  • Flickr Photos

    Dublin

    Dublin



    Garda

    Twins

    More Photos
  •  

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

Archive for March 31st, 2009

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

 

 

 

Posted in Uncategorized | Tagged: , , , , , , , , , , , , , , | Leave a Comment »