Showing posts with label Bind CheckedListBox Directly with Datatable in C#. Show all posts
Showing posts with label Bind CheckedListBox Directly with Datatable in C#. Show all posts

Tuesday, July 14, 2009

Bind CheckedListBox Directly with Datatable in C#

chkListBuilding.Items.Clear();
DataTable dtBuilding = (new BuildingManager()).SelectBuilding();
((ListBox)chkListBuilding).DataSource = dtBuilding;
((ListBox)chkListBuilding).DisplayMember = "BuildingName";
((ListBox)chkListBuilding).ValueMember = "BuildingID";