Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8230779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:14:48+00:00 2026-06-07T17:14:48+00:00

Okay, this is so frustrating now. I have a GridView with 9 columns. I

  • 0

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!

<script type="text/javascript">
    var table = $('<table></table>');
    var grid = document.getElementById('<%=BillabilityView.ID %>'); // here it is inputting gridview.
    $(document).ready(function () {
        $(".tbl tr:has(td)").css({ background: "ffffff" }).click(
             function () {
                 var row = $('<tr></tr>').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);
             }
        );
    }); 
</script> 

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?

EDIT: Here is the asp.net side of it:

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

                </columns>
            </asp:GridView>
            <div id = "please">
            </div>

Heck we’ll even throw the c# in it for kicks

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);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:14:50+00:00Added an answer on June 7, 2026 at 5:14 pm

    Please change the lines below

    var grid = document.getElementById('<%=BillabilityView.ID %>');
    $(document).ready(function () {
    

    To this way

    $(document).ready(function () {
      var grid = $("#BillabilityView");
    

    PS: For consistency sake please use jquery to getElementById instead of document.getElementById

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this is what I have so far. I have a form that needs
Okay, I have been messing with this autocomplete stuff for 2 weeks now, and
This shows me all the first names and last names that have exactly two
Okay this is one of those situations where I have concluded that I am
Okay this question is very simple: I have a facebook page, and a website.
Okay this may be a simple question but I have yet to come with
Okay - this is the dumbest glitch I have seen in a while: <!DOCTYPE
Okay this is very hard to explain, but i want to add padding to
Okay this is frustrating me to no end. I recently coded a page in
Okay so I have encountered a frustrating issue with namespaces. I am currently using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.