Web User Control, Repeater, Databound, add radio button(s), select

Web User Control, Repeater, Databound, add radio button(s), select

Post by RXNraW1 » Thu, 24 Feb 2005 03:49:02


i,

I had a similar question that was answered with a linkbutton; now I need
the functionality of a radiobutton inside of a databound repeater where
you select one row; now how do I get to the radio button that's selected and
ensure that only one row is selected (it's a pick/choose one at a time type
of thing)...

Thanks!

what I have:

control:

<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="CoursesRadioButton.ascx.cs"
Inherits="HSTM.HAC.Course.Exchange.Web.Controls.CoursesRadioButton"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<HTML>
<HEAD>
<link href="../style/ac_style.css" type="text/css" rel="stylesheet">
</HEAD>
<asp:Repeater id="CoursesRepeater" runat="server">
<HeaderTemplate>
<table id="tblCourses" class="" cellspacing="4" cellpadding="4"
width="100%">
<tr style="background-color:#E0E0E0">
<td></td>
<td>courseId</td>
<td>courseTitle</td>
<td>courseLocation</td>
<td>createDt</td>
<td>updateDt</td>
<td>liveDt</td>
<td>importsPending</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:#F0F0F0">
<td><input type="radio" name='rad' value='<%#
DataBinder.Eval(Container.DataItem,"courseId") %>' runat="server"></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"courseId") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"courseTitle") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"courseLocation") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"createDt") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"updateDt") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"liveDt") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"importsPending") %></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr style="background-color:#E0E0E0">
<td><input type="radio" name='rad' value='<%#
DataBinder.Eval(Container.DataItem,"courseId") %>' runat="server"></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"courseId") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"courseTitle") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"courseLocation") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"createDt") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"updateDt") %></td>
<td align="left"><%#
DataBinder.Eval(Container.DataItem,"liveDt") %&g
 
 
 

1. Selecting Radio Button in Web Browser Control

2. Composite control delegating databound templated features to child <asp:repeater> control

Hi Everybody,

I'm creating a composite control in C# that basically renders a bunch of
webcontrols such as <asp:Label />, <asp:Repeater />, etc... as its children.

My goal is to re-use the functionality of the <asp:Repeater /> control to
allow the page developer to take advantage of the Data-bound, Templated
features the <asp:Repeater /> offers. (I'd like to avoid building that
functionality from scratch in my control).

The question is:

When the page developer using VS.NET drags my control onto an .aspx page,
I'd like the developer to be able to add his/her own template code
<ItemTemplate>, etc... and have the processing of the inline template code
and data-binding expressions delegate down to my child <asp:Repeater> for
rendering.

e.g.

<my:CompositeCtrl id="Cntrl1" runat="server">

//... The <asp:Repeater> child in my control would handle this block
...
<HeaderTemplate>Title</HeaderTemplate>
<ItemTemplate>
<li><a href="<%# DataBinder.Eval(Container.DataItem,
"URL") %>">
<%# DataBinder.Eval(Container.DataItem, "Name")
%></a></li>
</ItemTemplate>
<FooterTemplate>Footer Text</FooterTemplate>
etc...

</my:CompositeCtrl>


Is this possible?

Thanks for any help!
Sam

3. Radio button List problem: How to find value of Radio button list's Selected Item using javascript??

4. yet another toggle button question... user selects radio box toggle, then selects it again...

5. Need to dynamically add <ASP:Button> controls to web user control w.in page

6. yet another toggle button question... user selects radio box toggle, then selects it again...

7. Initialization of a Web User Control inside Repeater Control

8. binding user control to repeater web control

9. Checking radio button in radio button control array

10. binding user control to Repeater web control

11. Repeater control in a web user control

12. Radio button controlling other radio button

13. databound custom controls vs composite databound custom controls

14. Adding a web user control to a web control library

15. Possible to add Web User Control to a Web Control Library?