Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Repeater + RadioButtonList

Reply
Thread Tools

Repeater + RadioButtonList

 
 
Guldo K
Guest
Posts: n/a
 
      11-05-2005
Hello

I need some help...
I have a repeater; its source is a dataview based on a datatable of a
dataset.
The aspx page creates a radiobuttonlist for each item in the repeater:
<asp:Repeater>
<ItemTemplate>
<asp:RadioButtonList ... DataSource='<%#
GetDataView(Databinder.Eval(Container.DataItem, "myField") %>' ... >
....

where GetDataView returns a dataview, based on "myField", and "myField"
belongs to the first dataview.
(the DataSource property of the Repeater is set in the C# code)

Question:
Whenever the user clicks on an element of a RadioButtonList, I need to
know which row of the repeater is the current one, that is, what's the
current value of "myField".
How can I?

Thanks ^^

--
Guldo
www.giapponegiappone.it
Powered by Debian Sid
 
Reply With Quote
 
 
 
 
GJH
Guest
Posts: n/a
 
      12-06-2005
Here is something I did with a datagrid, so it should be very similar. Call
this in either a button click or autopostback of the radiobutton. Hope this
helps.



Dim myDataGridItem As DataGridItem

Dim chkSelected As System.Web.UI.WebControls.CheckBox

Dim strPDF As String

Dim strActive As String

Dim strNewsID As String

Dim strDDL As String

lblStatus.Text = "<br>You selected the Following items:<br><br>"

For Each myDataGridItem In DataGrid1.Items

chkSelected = myDataGridItem.FindControl("chkSelection")

If chkSelected.Checked Then

strPDF = CType(myDataGridItem.FindControl("lblPDF"), Label).Text

strActive = CType(myDataGridItem.FindControl("lblActive"), Label).Text

strDDL = CType(myDataGridItem.FindControl("DropDownList1"),
DropDownList).SelectedItem.Text

strNewsID = myDataGridItem.Cells(2).Text

lblStatus.Text += "The PDFs are: <b>" & strPDF & "</b> "

lblStatus.Text += "The Actives are: <b>" & strActive & "</b> "

lblStatus.Text += "The strDDL are: <b>" & strDDL & "</b> "

lblStatus.Text += " and the NewsIDs are: <b>" & strNewsID & "</b><br>"

End If

Next



"Guldo K" <guldo@no_spam.it> wrote in message
news:X_5bf.47024$(E-Mail Removed)...
> Hello
>
> I need some help...
> I have a repeater; its source is a dataview based on a datatable of a
> dataset.
> The aspx page creates a radiobuttonlist for each item in the repeater:
> <asp:Repeater>
> <ItemTemplate>
> <asp:RadioButtonList ... DataSource='<%#
> GetDataView(Databinder.Eval(Container.DataItem, "myField") %>' ... >
> ...
>
> where GetDataView returns a dataview, based on "myField", and "myField"
> belongs to the first dataview.
> (the DataSource property of the Repeater is set in the C# code)
>
> Question:
> Whenever the user clicks on an element of a RadioButtonList, I need to
> know which row of the repeater is the current one, that is, what's the
> current value of "myField".
> How can I?
>
> Thanks ^^
>
> --
> Guldo
> www.giapponegiappone.it
> Powered by Debian Sid



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RadioButtonList value in repeater IFIA ASP .Net 0 03-13-2008 04:06 PM
Handling Radiobuttonlist event inside Repeater Control Ravi ASP .Net 2 08-18-2006 06:56 AM
setting selecteditem item on databound radiobuttonlist in a repeater Rod Snyder ASP .Net 1 02-17-2005 03:49 AM
RadioButtonList in Repeater Control...Ouch Darren ASP .Net 1 09-28-2004 06:10 PM
RadioButtonList in a repeater David Davis ASP .Net 0 10-21-2003 05:56 PM



Advertisments