Hiding rows in an ASP.NET table

Discussion in 'ASP .Net' started by chris f, Jun 11, 2008.

  1. chris f

    chris f Guest

    I have an ASP.NET 2 web page that dynamically populates an ASP table in the
    Page_Load event. Rows relate to different people and I want to let the user
    display only rows for a particular person when they select them from a
    dropdown list on the same page. (Each row has a hidden PersonId column.) The
    page initially shows the rows for all people.

    Is it possible to hide the rows for the other people when the user selects a
    person from the dropdown list? I want avoid having to load the page again
    because the database query that gets the data for the table can take some
    time. Any client-side scripting would have to be in Javascript.
    chris f, Jun 11, 2008
    #1
    1. Advertising

  2. On Jun 11, 8:21 am, "chris f" <> wrote:
    > I have an ASP.NET 2 web page that dynamically populates an ASP table in the
    > Page_Load event. Rows relate to different people and I want to let the user
    > display only rows for a particular person when they select them from a
    > dropdown list on the same page. (Each row has a hidden PersonId column.) The
    > page initially shows the rows for all people.
    >
    > Is it possible to hide the rows for the other people when the user selects a
    > person from the dropdown list? I want avoid having to load the page again
    > because the database query that gets the data for the table can take some
    > time. Any client-side scripting would have to be in Javascript.


    Hi Chris,

    if table contents hidden ids, you can write a javascript to enumerate
    and hide rows. If you have the layout as following... how exactly the
    PersonId column looks like?

    <asp:Table runat="server">
    <asp:TableRow>
    <asp:TableCell ...></asp:TableCell>
    </asp:TableRow>
    </asp:Table>

    You can also consider to use Ajax and the UpdatePanel control to
    enable partial-page rendering of the resulting table and show "Please
    wait" during the process...
    Alexey Smirnov, Jun 11, 2008
    #2
    1. Advertising

  3. chris f

    Munna Guest

    On Jun 11, 12:21 pm, "chris f" <> wrote:
    > I have an ASP.NET 2 web page that dynamically populates an ASP table in the
    > Page_Load event. Rows relate to different people and I want to let the user
    > display only rows for a particular person when they select them from a
    > dropdown list on the same page. (Each row has a hidden PersonId column.) The
    > page initially shows the rows for all people.
    >
    > Is it possible to hide the rows for the other people when the user selects a
    > person from the dropdown list? I want avoid having to load the page again
    > because the database query that gets the data for the table can take some
    > time. Any client-side scripting would have to be in Javascript.


    Hi

    this is a simple article that demonstrate the javascript to hide or
    show tablerow

    http://www.javascriptf1.com/tutorial/javascript-hide-table-row.html?page=1

    Best of luck

    Munna
    www.munna.shatkotha.com
    www.munna.shatkotha.com/blog
    www.shatkotha.com
    Munna, Jun 11, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MattB

    hiding table rows by id?

    MattB, Mar 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    12,358
    MattB
    Mar 9, 2005
  2. luna

    Hiding table rows .asp

    luna, Jan 17, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    424
  3. Garg
    Replies:
    2
    Views:
    1,339
    Eliyahu Goldin
    Feb 15, 2007
  4. Rick Measham

    Hiding multiple rows in a dynamic table

    Rick Measham, Sep 23, 2003, in forum: Javascript
    Replies:
    1
    Views:
    243
    Martin Honnen
    Sep 23, 2003
  5. F. Da Costa

    Hiding rows in a table via <div>

    F. Da Costa, Dec 3, 2003, in forum: Javascript
    Replies:
    8
    Views:
    191
    F. Da Costa
    Dec 5, 2003
Loading...

Share This Page