aspx_professional thread: RadioButtonList inside of a datagrid, can't get selectedItem
Is there any reason you can't dynamically create the radiobuttonlist and
checkboxlist controls in Page_Init.
The control execution lifecycle is OnInit, LoadViewState, LoadPostData,
Load, ...
When LoadPostData is run, the controls are not created, so nothing can
be posted back.
I've been doing my datagrid binding in the Page_Load.
Doug
-----Original Message-----
From: Michael Bleed [mailto:mbleed@y...]
Sent: Thursday, February 28, 2002 2:55 PM
To: ASPX_Professional
Subject: [aspx_professional] RE: RadioButtonList inside of a datagrid,
can't get selectedItem
The datagrid gets bound in the Page_Init event (I have tried it in
Page_load too to no avail). Then, within the OnItemDataBound event for
each row of the datagrid, I dynamically create the radiobuttonlist or
checkboxlist.
> Michael,
>
> Are you dynamically creating them in the OnInit (Page_Init) event?
>
> Doug
>
>
>
> -----Original Message-----
> From: Michael Bleed [mailto:mbleed@y...]
> Sent: Wednesday, February 27, 2002 10:37 PM
> To: ASPX_Professional
> Subject: [aspx_professional] RadioButtonList inside of a datagrid,
> can't get selectedItem
>
>
> I have created a datagrid which lists survey questions coming from a
> database. I use the OnItemDataBound property of the datagrid to bind
> a set of possible responses for each question as it is created. The
> responses come in a form of radio buttons, checkboxes, or textboxes.
> They are created dynamically from within the OnItemDataBound method
> using e.Item (I)Cells(C).Controls.Add. I can get them to display
> fine, and I can interact with the controls, but I can't get the
> selectedItems to see what the results are. I am trying to post the
> results back to the database in the onSubmitButton_click event. I
> have tried FindControl, and I get no instance for this object
> error...Any ideas on why I can't reference these dynamic controls'
> values?
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
> $subst('Email.Unsub').
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
$subst('Email.Unsub').