bon733
Posts: 25
|
Posted: 10/05/2006, 9:46 PM |
|
I have an editable grid that contains an item number (label containing 1,2,3,4,etc... depending on the value of {QAItemNbr} from the database) and a radio button (that contains five options OK, NOK, etc...). When adding an onlick event, the event is placed on a SPAN and not the radio buttons. My question is how can I get the value of the radio button when selected, and how do I tell which item number (or row) the radio button is related to?
I have added code from the resulting aspx and the source html for review.
Here is a sample of the coding produced by CCS 3.0, the row number is 2 and
....
<tr class="Row th" style="BORDER-BOTTOM: thin solid">
<td style="FONT-SIZE: 11px; BORDER-BOTTOM: thin solid" valign="top" align="center">2
</td>
<td style="FONT-SIZE: 11px; BORDER-BOTTOM: thin solid" valign="top" nowrap>
<span id="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus" size="10" onclick="SaveStatus(this,);"><input id="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_0" type="radio" name="uvwQACDetailRepeater:_ctl2:uvwQACDetailItemStatus" value="OK " /><label for="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_0">OK </label><input id="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_1" type="radio" name="uvwQACDetailRepeater:_ctl2:uvwQACDetailItemStatus" value="NOK" /><label for="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_1">NOK </label><input id="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_2" type="radio" name="uvwQACDetailRepeater:_ctl2:uvwQACDetailItemStatus" value="NR " /><label for="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_2">NR </label><input id="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_3" type="radio" name="uvwQACDetailRepeater:_ctl2:uvwQACDetailItemStatus" value="PS " /><label for="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_3">PS </label><input id="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_4" type="radio" name="uvwQACDetailRepeater:_ctl2:uvwQACDetailItemStatus" value="NA " /><label for="uvwQACDetailRepeater__ctl2_uvwQACDetailItemStatus_4">NA </label></span></td>
<td style="FONT-SIZE: 11px; BORDER-BOTTOM: thin solid" valign="top" nowrap align="left" width="300">Moisture barrier lapped, tight; </td>
Here is the HTML code from within my app:
<tr class="Row th" style="BORDER-BOTTOM: thin solid">
<td style="FONT-SIZE: 11px; BORDER-BOTTOM: thin solid" valign="top" align="center">{QAItemNbr}</td>
<td style="FONT-SIZE: 11px; BORDER-BOTTOM: thin solid" valign="top" nowrap>
<!-- BEGIN RadioButton ItemStatus --><font size="1"><input type="radio" size="10" value="{Value}" name="{ItemStatus_Name}" onclick="SaveStatus(this,{QAItemNbr});">{Description} </font><!-- END RadioButton ItemStatus --></td>
|
|
|
FrankR
Posts: 154
|
Posted: 10/06/2006, 3:37 AM |
|
Quote bon733:
I have an editable grid that contains an item number (label containing 1,2,3,4,etc... depending on the value of {QAItemNbr} from the database) and a radio button (that contains five options OK, NOK, etc...). When adding an onlick event, the event is placed on a SPAN and not the radio buttons. My question is how can I get the value of the radio button when selected, and how do I tell which item number (or row) the radio button is related to?
I'd give you an exact code clip if I was at my desk, but I'm home, away from the work desk, due to Mr. Mom duties today.
I'm not sure about doing this after a click, but in the BeforeShow of the Row, you get an
e RepeaterItem
that will have everything you need.
Using the RepeaterItem, you can do a FindControl, get access to the Control, and read whatever you need.
Actually, ask for an Add Code for BeforeShowRow, and then scroll around. You'll see other code generated by CCS for Finding the Control and accessing it.
Hope this helps.
_________________
FR |
|
|
|