If you are creating the radio button dynamically in
databound event.. Then you should make sure that the grid
is bound before the viewstate is loaded.
Please check this article. Might be helpful.


>-----Original Message-----
>I am binding a radiobuttonlist to a datagrid on the
ItemDataBound event. See code:
>Sub dtgAccesSite_ItemDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> Dim radAcces As New RadioButtonList
> radAcces.Items.Insert(0, "Oui")
> radAcces.Items.Insert(1, "Non")
> radAcces.Items(1).Selected = True
> radAcces.Items(0).Selected = False
> e.Item.Cells(3).Controls.Add(radAcces)
>End Sub
>And I'm trying to retrieve the radiobuttonlist value on
the Button_click event e.g. Save Button found outside the
datagrid. See code:
>Private Sub btnSave_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnSave.Click
> Dim i As Integer
> Dim _item As DataGridItem
> For i = 0 To dtgAccesSite.Items.Count - 1
> _item = dtgAccesSite.Items(i)
> Dim Usr_radio As RadioButtonList =
> Usr_radio.SelectedItem.Value
> Next
>End Sub
>It cannot find the RadioButtonList "radAcces" anywhere in
the datagrid - can anyone help - this code will work using
textbox, labels, etc.
>Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])