|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Checkbox within a datalistI 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. 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 Show quoteHide quote > 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. >
Please...Expert needed.
Click checkbox's label - javascript onclick gets called twice Problem with FindControl Changing the document.title from a user control Validation not working in paging Using a Stylesheet in a User Control Handling Events for Dynamically Created Controls File uploaded to server....How can I delete it? anyone who has used the FreeTextBox ? fill dropdown list thru dataset |
|||||||||||||||||||||||