Unable to put my GridView into my javascript variable
<p>Okay, this is so frustrating now. I have a GridView with 9 columns. I have 3 of them showing and I want to have a seperate table that shows the other 6 when I click on the row. I have my javascript function set up to put in my selected row into a new table when I click it... except it doesn't work!</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var table = $('&lt;table&gt;&lt;/table&gt;');
    var grid = document.getElementById('&lt;%=BillabilityView.ID %&gt;'); // here it is inputting gridview.
    $(document).ready(function () {
        $(".tbl tr:has(td)").css({ background: "ffffff" }).click(
             function () {
                 var row = $('&lt;tr&gt;&lt;/tr&gt;').addClass('bar').text(grid.rows[$(this).index()]); // here it is saying 'unable to get the value of property rows'
                 table.append(row);
                 $('#please').append(table);
             }
        );
    }); 
&lt;/script&gt; 
</code></pre>

<p>It is just not putting the gridview into my var! Even when I just do a check for grid.rows.length it doesn't understand rows. I am looking at other code samples and they do the same thing I'm doing and they say that it works fine. I am 100% sure that it is selecting my GridView. What is going on?</p>

<p>EDIT: Here is the asp.net side of it:</p>

<pre><code>&lt;asp:GridView ID="BillabilityView" BackColor="White" runat="server" AutoGenerateColumns="false" CssClass="tbl"&gt;
                &lt;columns&gt; 
                   &lt;asp:boundfield datafield="UserName" headertext="User Name" /&gt; 
                   &lt;asp:boundfield datafield="UserID" headertext="User ID" /&gt; 
                   &lt;asp:boundfield datafield="HrsTLB" headertext="Billable Hours" /&gt; 
                   &lt;asp:boundfield datafield="HrsTLNB" headertext="Nonbillable Hours" /&gt; 
                   &lt;asp:boundfield datafield="HrsTL" headertext="Total Hours" /&gt; 
                   &lt;asp:boundfield datafield="HrsExp" headertext="Expected Hours" /&gt; 
                   &lt;asp:boundfield datafield="Billability" headertext="Billability" /&gt;

                &lt;/columns&gt;
            &lt;/asp:GridView&gt;
            &lt;div id = "please"&gt;
            &lt;/div&gt;
</code></pre>

<p>Heck we'll even throw the c# in it for kicks</p>

<pre><code>BillabilityView.DataSource = dataList.retBillability();
BillabilityView.DataBind();
BillabilityView.RowDataBound += new GridViewRowEventHandler(BillabilityView_RowDataBound);

    void BillabilityView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.BackColor = Color.FromName("#ebebeb");
        }
        //e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink
         //   (this.BillabilityView, "Select$" + e.Row.RowIndex);
    }
</code></pre>
