checklistbox?

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 28th, 2003, 05:45
New Member
Join Date: Sep 2003
Location: Canada
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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);

}

}

Closed Thread

Tags
checklistbox

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43