rowselect in gridview

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi everyone

I am tryin to get the selected index from this gridview while selecting the
radiobuttonlist. I dont want to use a button for the row though. Anyone
knows how to do this?

thnks

Eric


<%@ Page Language="VB" %>

<script runat="server">


Protected Sub rbl_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim index As Integer

End Sub

</script>

<html>

<body>

<form id="form1" runat="server">

<table width="100%">

<tr>

<td style="width: 50%">

<asp:GridView ID="CustomersGridView" DataSourceID="CustomersSource"
AllowPaging="true"

AutoGenerateColumns="false" runat="server">

<Columns>

<asp:BoundField DataField="CustomerID" HeaderText="Customer ID" />

<asp:BoundField DataField="CompanyName" HeaderText="Company Name" />

<asp:BoundField DataField="City" HeaderText="City" />

<asp:TemplateField>

<ItemTemplate>

<asp:RadioButtonList ID="rbl" runat="server" AutoPostBack="true"
OnSelectedIndexChanged="rbl_SelectedIndexChanged">

<asp:ListItem>

one

</asp:ListItem>

<asp:ListItem>two</asp:ListItem>

</asp:RadioButtonList>

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

</td>

<td style="vertical-align: top; width: 51%">

</td>

</tr>

</table>

<asp:SqlDataSource ID="CustomersSource" SelectCommand="select * From
Customers"

connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server" />

</form>

</body>

</html>


.


Quantcast