Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DataGrid / Mutually Exclusive

Reply
Thread Tools

DataGrid / Mutually Exclusive

 
 
g2
Guest
Posts: n/a
 
      08-03-2003
To my understanding it is not possible to have mutually exclusive radio
button controls in a datagrid.
(http://support.microsoft.com/default...;EN-US;Q316495). I have
read that it is possible to just emit standard input radio tags in the
itemtemplate column and the radio buttons should be mutually exclusive. I
have tried the below but I still do not get mutually exclusive controls. Any
ideas? Thanks.

<asp:TemplateColumn>
<ItemTemplate>
<INPUT id="rbcust" type="radio" runat="server">
</ItemTemplate>
</asp:TemplateColumn>


 
Reply With Quote
 
 
 
 
Sonali.NET[MVP]
Guest
Posts: n/a
 
      08-03-2003
Try
<aspataGrid id="DataGrid1" AutoGenerateColumns="False" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="FirstName">
<ItemTemplate>
<input type="radio" name="optSelectedName" value=<%#DataBinder.Eval(Container.DataItem, "FirstName") %> onclick="javascript:txtFname.value = this.value;"><%#DataBinder.Eval(Container.DataItem , "FirstName") %>
<br>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</aspataGrid>
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 154px; POSITION: absolute; TOP: 103px" runat="server" Text="Button"></asp:Button>
<div style="VISIBILITY: hidden">
<asp:TextBox ID="txtFname" Runat="server" />
</div>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

Dim myconnection As SqlConnection = New SqlConnection("server=localhost;uid=sa;password=;d atabase=northwind")

Dim myda As SqlDataAdapter = New SqlDataAdapter("Select * from Employees", myconnection)

Dim ds As DataSet = New DataSet()

myda.Fill(ds, "AllTables")

DataGrid1.DataSource = ds

DataGrid1.DataBind()

End Sub



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Response.Write ("You have selected :" & txtFname.Text)

End Sub


HTH
Regards
Sushila
..NET MVP

"g2" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> To my understanding it is not possible to have mutually exclusive radio
> button controls in a datagrid.
> (http://support.microsoft.com/default...;EN-US;Q316495). I have
> read that it is possible to just emit standard input radio tags in the
> itemtemplate column and the radio buttons should be mutually exclusive. I
> have tried the below but I still do not get mutually exclusive controls. Any
> ideas? Thanks.
>
> <asp:TemplateColumn>
> <ItemTemplate>
> <INPUT id="rbcust" type="radio" runat="server">
> </ItemTemplate>
> </asp:TemplateColumn>
>
>


 
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
how to make check box in different columns in datagrid mutually exclusive xonet ASP .Net Datagrid Control 2 06-14-2006 03:24 PM
'SelectedIndex' and 'SelectedValue' attributes are mutually exclusive (part 2) Stimp ASP .Net 5 11-08-2005 04:16 PM
'SelectedIndex' and 'SelectedValue' attributes are mutually exclusive Stimp ASP .Net 2 10-24-2005 01:53 PM
mutually exclusive radio button js ASP .Net 2 05-19-2005 04:27 PM
Mutually exclusive ALuPin VHDL 2 09-07-2004 04:41 PM



Advertisments