Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Checkbox within a datalist

Reply
Thread Tools

Checkbox within a datalist

 
 
UJ
Guest
Posts: n/a
 
      05-24-2005
I have a datalist with a checkbox in it to tell whether something is
selected or not. Once somebody changes the checked value and I call the
OnCheckedChanged routine, there doesn't seem to be enough information to
figure out which row the record belongs to. I've look at the sender object
in the debugger and it doesn't have enough to make it useful.

What are people doing to make this work?

TIA.

Jeffrey.


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      05-25-2005
Yeah, unfortunately the CheckBox doesn't bubble the event up to the DataGrid.
You could use the sender parameter and walk up the Control.Parent tree until
you find the DataGridItem which is the row in the table. Once you have the
DataGridItem, you'll know the ItemIndex and then you can use that to index
into the DataGrid's DataKey collection to get the primary key for the item.
It's a hack, but it works.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> I have a datalist with a checkbox in it to tell whether something is
> selected or not. Once somebody changes the checked value and I call
> the OnCheckedChanged routine, there doesn't seem to be enough
> information to figure out which row the record belongs to. I've look
> at the sender object in the debugger and it doesn't have enough to
> make it useful.
>
> What are people doing to make this work?
>
> TIA.
>
> Jeffrey.
>




 
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
Problem with DataList within DataList Will ASP .Net Web Controls 4 10-18-2007 03:19 AM
CheckBox Outside DataList & Labels Inside DataList rn5a@rediffmail.com ASP .Net 1 12-24-2006 02:28 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