Hiding rows in an ASP.NET table


C

chris f

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.
 
Ad

Advertisements

A

Alexey Smirnov

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...
 
Ad

Advertisements

M

Munna

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top