Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > checkbox in datalist

Reply
Thread Tools

checkbox in datalist

 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      09-23-2004
I have a datalist with checkboxes and what I want to do is, to allow the user
select the check box(s) and click a button. When the click the button i want
it to only show the items selected. Either open a new page with the selected
items or hide the items not checked. Has anyone done this or can anyone point
me to somewhere that shows this or something like this?
thx
 
Reply With Quote
 
 
 
 
Martin Dechev
Guest
Posts: n/a
 
      09-24-2004
Try this:

protected void button1_Click(object s, EventArgs e)
{
int i = 0;
while(i < checkBoxList1.Items.Count)
{
if(!checkBoxList1.Items[i].Selected)
{
checkBoxList1.Items.RemoveAt(i);
continue;
}
i++;
}
}

Greetings
Martin
"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a datalist with checkboxes and what I want to do is, to allow the

user
> select the check box(s) and click a button. When the click the button i

want
> it to only show the items selected. Either open a new page with the

selected
> items or hide the items not checked. Has anyone done this or can anyone

point
> me to somewhere that shows this or something like this?
> thx



 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckBox Outside DataList & Labels Inside DataList rn5a@rediffmail.com ASP .Net 1 12-24-2006 02:28 PM
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
disable checkbox list checkbox Vikram ASP .Net 1 01-25-2006 02:59 PM
Text on Checkbox below the checkbox tshad ASP .Net 0 04-14-2005 11:26 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM



Advertisments