Function to bind Generic Dictionary with dropdown list.

With the tip from the post How to bind Generic Dictionary with dropdown list  I've created the static method:

          //'http://blogs.msdn.com/piyush/archive/2006/10/17/how-to-bind-generic-dictionary-with-dropdown-list.aspx

        public static void ControlBinding(ListControl ctrl, Dictionary<string, string> dict)

        {

            ctrl.DataSource = dict;

            ctrl.DataValueField = "Key";

            ctrl.DataTextField= "Value";

        }

//Overload for StringDictionary      
 public static void ControlBinding(ListControl ctrl, StringDictionary dict)
        {
            ctrl.DataSource = dict;
            ctrl.DataValueField = "Key";
            ctrl.DataTextField = "Value";
        }
 

 Hopefully, it would help someone.

 Similar method for table:

       public static void ControlBinding(ListControl ctrl, DataTable tbl,string valueField, string textField)
        {
            ctrl.DataSource = tbl;
            ctrl.DataValueField = valueField;
            ctrl.DataTextField = textField;
        }
 
«December»
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456