Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Shailesh Jannu #1
Retrieving radiobuttonlist from datagrid
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.
[url]http://msdn.microsoft.com/library/default.asp?[/url]
url=/library/en-
us/dv_vstechart/html/vbtchTopQuestionsAboutASPNETDataGridSe
rverControl.asp
ItemDataBound event. See code:>-----Original Message-----
>I am binding a radiobuttonlist to a datagrid on theByVal e As>
>Sub dtgAccesSite_ItemDataBound(ByVal sender As Object,
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dtgAccesSite.ItemDataBoundthe Button_click event e.g. Save Button found outside the> 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
datagrid. See code:ByVal e As System.EventArgs) Handles btnSave.Click>
>Private Sub btnSave_Click(ByVal sender As System.Object,_item.FindControl("radAcces")> 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 =the datagrid - can anyone help - this code will work using> Usr_radio.SelectedItem.Value
> Next
>
>End Sub
>
>It cannot find the RadioButtonList "radAcces" anywhere in
textbox, labels, etc.>
>-----------------------
>Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])
>
><Id>IZ0RX2FFAUCcdF6hzR2BNw==</Id>
>.
>Shailesh Jannu Guest
-
RadioButtonList within DataGrid
Hi. I'm trying to make a datagrid with a RadioButtonList on each row: <asp:TemplateColumn HeaderText="Action"> <ItemTemplate>... -
RadioButtonList In DataGrid
Hi all! I have a page that gets a list of users from a database and puts them into a DataGrid. The DataGrid is editable. In Edit Mode of the... -
RadioButtonList In DataGrid (edited e-mail address)
Hi all! I have a page that gets a list of users from a database and puts them into a DataGrid. The DataGrid is editable. In Edit Mode of the... -
Datagrid - dynamic radiobuttonlist problems...
Hi, I have a regular datagrid named dgTest For each row in dgtest I have added a dynamic radiobuttonlist (each with the same options) with a... -
RadioButtonList in Nested DataGrid Problem
I am trying to do some of the things we used to do in classic ASP that required some pretty ugly loops in the .ASP page. I have two different...



Reply With Quote

