Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Man I hate to ask a question like this but...

Status
Not open for further replies.

onedizzydevil

Programmer
Mar 24, 2001
103
US
...I am at the end of short rope.

What I need to do is have a DataGrid Control. One of those columns in that DataGrid Control need to contain RadioButton Controls for each row.

This is the problem I am running into, I ONLY want ONE RadioButton item can be selected. For some reason, when the code runs it renames everything, IDs, GroupNames, and etc.

Then the part that I have not gotten to yet, is once a RadioButton item is selection I need to determine the value of the selected item and then I am all set.

Now I posted a previous question dealing with the exact same problem and comments that I received that did not help with anything.

Will someone please look at this code and tell me if I am just flat out completely missing something here obvious. It can not be this complication to do this.

HTML:
<asp:datagrid id=&quot;dgActive&quot; runat=&quot;server&quot; width=&quot;100%&quot; AutoGenerateColumns=&quot;False&quot; OnSortCommand=&quot;listGroupUsers_SortCommand&quot; OnPageIndexChanged=&quot;listGroupUsers_PageIndexChange&quot; PageSize=&quot;13&quot; AllowSorting=&quot;true&quot; AllowPaging=&quot;true&quot; AllowCustomPaging=&quot;false&quot; PagerStyle-Mode=&quot;NumericPages&quot; datakeyField=&quot;userID&quot; ItemStyle-Font-Size=&quot;10pt&quot; HeaderStyle-Font-Size=&quot;10pt&quot; AlternatingItemStyle-BackColor=&quot;#e8e8e8&quot; ItemStyle-BackColor=&quot;#f8f8f8&quot; HeaderStyle-BackColor=&quot;palegoldenrod&quot; PagerStyle-BackColor=&quot;palegoldenrod&quot; PagerStyle-CssClass=&quot;copy&quot; PagerStyle-HorizontalAlign=&quot;Center&quot; PagerStyle-Position=&quot;Bottom&quot;>
<Columns>
  <asp:TemplateColumn>
    <ItemTemplate><asp:RadioButton id=&quot;rdoButton&quot; GroupName=&quot;intUSERID&quot; runat=&quot;server&quot;/></ItemTemplate>
  </asp:TemplateColumn>
  <asp:TemplateColumn HeaderText=&quot;User Name&quot;>
    <ItemTemplate><%# databinder.eval(container.dataitem, &quot;username&quot;)%></ItemTemplate>
  </asp:TemplateColumn>
</Columns>
</asp:datagrid>

[codebehind]
Dim a As New Authentication()
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'//This is how to bind to a data source
If Not Request.IsAuthenticated Then
Server.Transfer(&quot;/s-backend/login.aspx&quot;)
ElseIf Not Page.IsPostBack Then
fillDGGroups(a.groupIdIs, lblSortCommand.Text, statusType.Active)
End If
End Sub

Sub fillDGGroups(ByVal group As Integer, ByVal strSortCommand As String, Optional ByVal removed As statusType = statusType.Active)
Try
Dim r As New List.Group()
Dim ds As New DataSet()
Select Case removed
Case statusType.Active
ds = r.Users(group, strSortCommand, statusType.Active)
Case statusType.Inactive
ds = r.Users(group, strSortCommand, statusType.Inactive)
Case statusType.Both
ds = r.Users(group, strSortCommand, statusType.Both)
End Select
dgActive.DataSource = ds
dgActive.DataBind()

Catch exp As Exception
lblError.Text = exp.Message
Finally
End Try
End Sub

Sub listGroupUsers_PageIndexChange(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
dgActive.CurrentPageIndex = e.NewPageIndex
fillDGGroups(a.groupIdIs, lblSortCommand.Text, statusType.Active)
End Sub

Private Sub iBtnEdit_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles iBtnEdit.Click

End Sub

Private Sub iBtnPermissions_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles iBtnPermissions.Click

End Sub

Private Sub iBtnRemove_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles iBtnRemove.Click

End Sub
[/codebehind]

I know this is a lot to ask but I appreciate any help I can get on this. Either something is wrong with my computer or I am making one those stupid mistake that I will more than likely kick myself for when its found, but I am just completely out of options here. I have done everything I know to do at this point.

Thanks a bunch for your help.

Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
Here is the correct answer for any who wants to know.


Wayne Sellars

&quot;Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top