This is a discussion on "checklistbox?" within the ASP.NET Forum section. This forum, and the thread "checklistbox? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
checklistbox?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
checklistbox?
I have to populate a checklistbox.
This is example of a listbox. How would I do it for a checklistbox private void FillcblNightlife(DataView data) { this.cblNightlife.DataSource = data; this.cblNightlife.DataMember = "title"; this.cblNightlife.DataTextField = "text"; this.cblNightlife.DataValueField = "value"; this.cblNightlife.DataBind(); // restore the selected title (if a user had already selected a title on a previous page session) if (Session["webform6_cblNightlife] !=null) { foreach (ListItem item in this.cblNightlife.Items) { if (item.Value == Session ["webform6_cblNightlife].ToString()) { this.cblNightlife.SelectedIndex = this.cblNightlife.Items.IndexOf(item); } } } // property delivers the list of Nightlife private DataView NightlifesList { get { DataSet myDataSet = new DataSet (); myDataSet.ReadXml(Server.MapPath("PersonalInterest s/Nightlifes.xml")); return (myDataSet.Tables["nightlife].DefaultView); } } |
|
|
![]() |
| Tags |
| checklistbox |
| Thread Tools | |
|
|