I have 2 GridViews nested one in another with radio button list controls. The first Grid view's Radio Button list have list items like Yes, No, N/A. When the "No" List item is clicked it should show the nested grid view and its associated radio buttons.

I can see all the grid views and its associated radiobuttons when the page is loaded but the gridview2 doesnot show and hide when the "no" radiobutton is clicked. I used javascript for that functionality but not working as desired. I am providing my vb.net code and aspx code. Any help is appreciated.

**Vb.net Code**

Public Class \_Default

```
Inherits Page

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

    If Not IsPostBack Then

        GridView1.DataSource = GetData("select * from Questions")

        GridView1.DataBind()

    End If

End Sub

Private Shared Function GetData(query As String) As DataTable

    Dim strConnString As String = ConfigurationManager.ConnectionStrings("String").ConnectionString

    Using con As New SqlConnection(strConnString)

        Using cmd As New SqlCommand()

            cmd.CommandText = query

            Using sda As New SqlDataAdapter()

                cmd.Connection = con

                sda.SelectCommand = cmd

                Using ds As New DataSet()

                    Dim dt As New DataTable()

                    sda.Fill(dt)

                    Return dt

                End Using

            End Using

        End Using

    End Using

End Function

Protected Sub OnRowDataBound(sender As Object, e As GridViewRowEventArgs)

    If e.Row.RowType = DataControlRowType.DataRow Then

        Dim questid As String = GridView1.DataKeys(e.Row.RowIndex).Value.ToString()

        Dim GridView2 As GridView = TryCast(e.Row.FindControl("GridView2"), GridView)

        GridView2.DataSource = GetData(String.Format("SELECT * from Standards where Questions= '{0}'", questid))

        GridView2.DataBind()

    End If

End Sub

```

End Class

**Aspx Page**

```
<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="Grid"
 DataKeyNames="QstnID" OnRowDataBound="OnRowDataBound">
    <Columns>
        <asp:BoundField DataField="Question" HeaderText="Questions" />  
   <asp:TemplateField>
    <ItemTemplate> 
            <asp:RadioButtonList ID="QuestList" runat="server" DataValueField="Question" RepeatDirection="Horizontal">
              <asp:ListItem Enabled="False" Style="display: none" Text="" Value="0"></asp:ListItem>
              <asp:ListItem Value="Yes">Yes</asp:ListItem>
              <asp:ListItem Value="No">No</asp:ListItem>
              <asp:ListItem Value="N/A">N/A</asp:ListItem>
             </asp:RadioButtonList>
        <br> 
       </br>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false" CssClass="ChildGrid" GridLines="None">
            <Columns>
                <asp:BoundField DataField="Description" HeaderText="Standards" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:RadioButtonList ID="StandList" runat="server" DataValueField="Description" RepeatDirection="Horizontal">
                            <asp:ListItem Enabled="False" Style="display: none" Text="" Value="0"></asp:ListItem>
                            <asp:ListItem Value="Yes">Yes</asp:ListItem>
                            <asp:ListItem Value="No" Selected="False">No</asp:ListItem>
                            <asp:ListItem Value="N/A">N/A</asp:ListItem>
                        </asp:RadioButtonList>
                        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <br>
        </br>

    </ItemTemplate>
   </asp:TemplateField>
  </Columns>
</asp:GridView> 

<asp:SqlDataSource ID="Response" runat="server" ConnectionString="<%$ ConnectionStrings:String1%>" SelectCommand="SELECT [Description] FROM [Standards]"></asp:SqlDataSource>
<asp:SqlDataSource ID="WcmQC" runat="server" ConnectionString="<%$ ConnectionStrings:String2 %>" SelectCommand="SELECT [Question] FROM [Questions]"></asp:SqlDataSource>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
$(document).ready(function () {
        $('#QuestList input').click(function () {
            var value = $('#QuestList input:checked').val();
            if (value == "Yes") {
                $("#GridView2").show();
             else {
                 $("#GridView2").hide();  
            }
            }
        });
    });
</script>

</asp:Content>

```