onedizzydevil
Programmer
...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.
[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("/s-backend/login.aspx"
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
"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."
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="dgActive" runat="server" width="100%" AutoGenerateColumns="False" OnSortCommand="listGroupUsers_SortCommand" OnPageIndexChanged="listGroupUsers_PageIndexChange" PageSize="13" AllowSorting="true" AllowPaging="true" AllowCustomPaging="false" PagerStyle-Mode="NumericPages" datakeyField="userID" ItemStyle-Font-Size="10pt" HeaderStyle-Font-Size="10pt" AlternatingItemStyle-BackColor="#e8e8e8" ItemStyle-BackColor="#f8f8f8" HeaderStyle-BackColor="palegoldenrod" PagerStyle-BackColor="palegoldenrod" PagerStyle-CssClass="copy" PagerStyle-HorizontalAlign="Center" PagerStyle-Position="Bottom">
<Columns>
<asp:TemplateColumn>
<ItemTemplate><asp:RadioButton id="rdoButton" GroupName="intUSERID" runat="server"/></ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="User Name">
<ItemTemplate><%# databinder.eval(container.dataitem, "username")%></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("/s-backend/login.aspx"
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
"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."