Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataList checkbox status

Reply
Thread Tools

DataList checkbox status

 
 
Vannela
Guest
Posts: n/a
 
      12-16-2003
I want to get the status of the checkbox control in the
item template of the DataList in the code behind

Using findcontrol i am not able to get the status of the
checkbox . How shouls i get the status of the checkbox
whether it is checked or not?\

Thank you
 
Reply With Quote
 
 
 
 
Claudio Perrone
Guest
Posts: n/a
 
      12-17-2003
Hi Vannela,
This piece of code should do (the key is to iterate the Items collection!).

foreach ( DataListItem item in ItemsList.Items )
{
CheckBox chk = (CheckBox) item.FindControl("CheckBox1");
bool checkedValue = chk.Checked;
}

Regards
Claudio

"Vannela" <(E-Mail Removed)> wrote in message
news:08fa01c3c395$8f3cdd60$(E-Mail Removed)...
> I want to get the status of the checkbox control in the
> item template of the DataList in the code behind
>
> Using findcontrol i am not able to get the status of the
> checkbox . How shouls i get the status of the checkbox
> whether it is checked or not?\
>
> Thank you



 
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
POST problem - IIS sc-win32-status:64; sc-status:400 saha ASP .Net 0 07-14-2005 07:10 AM
Help: Checkbox in datalist - checked status = ALWAYS FALSE! VB Programmer ASP .Net 1 04-13-2005 12:59 AM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
Hoe to get DataList Checkbox status in item template Vannela ASP .Net Building Controls 4 12-29-2003 09:24 AM



Advertisments