473,804 Members | 3,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding rows in an ASP.NET table

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.
Jun 27 '08 #1
2 3624
On Jun 11, 8:21*am, "chris f" <chrisfell...@n ospam.co.ukwrot e:
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 selectsa
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:TableCel l ...></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...
Jun 27 '08 #2
On Jun 11, 12:21 pm, "chris f" <chrisfell...@n ospam.co.ukwrot e:
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...ow.html?page=1

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8997
by: Rick Measham | last post by:
I have a set of data that I display in a table. Each row has a category and there may be a dozen or more rows in the same category. I'm looking to add filter buttons to the page to hide/show categories on the fly. Currently I can: Set the id on the tr to (category name) or to (category name.data id). Using the first, is there a way to hide all rows with that same id? It seems currently to only hide the first row with that id.
8
23999
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable <div> Hide/Show work but not the divRow version? What I'm trying to do here is simultaneously hide 1 or more rows (possibly with nested divs as well). This would allow for an elegant an well performing base for an html base treetable (but I guess...
5
1553
by: mt | last post by:
In a nutshell, I'd like to have a list of items, each of which fills out a small table which displays some info about a particular item(the items being a trouble ticket for a tech support ASP-built web-based app). There may be zero, one, or many of these per ticket. Since some tickets have many of these items (call them work items), the page can get awful long. I have this part working already. So my proposed solution to make the pages...
1
553
by: luvdairish | last post by:
Can someone please look at my code and see why tables are not hiding properly? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Untitled Document</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <SCRIPT type=text/javascript> <!--//
6
1380
by: luvdairish | last post by:
I tried posting a few times, but it hasn't shown up. Hope this one works. Problem: Having trouble hiding tables when page is loaded. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Untitled Document</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
5
2175
by: Ben | last post by:
I have a form for data entry which is in a table. I have a select box to enter a customer name, which takes it's options from the customer database. I have a button to add a new customer. What I want is for the relevant customer fields to magically appear underneath the selelect box when the "add customer button" is pressed. For some reason my code is NOT working. Have been trying to do it with div tags and style sheets using a...
6
1994
by: Roy | last post by:
Since a datagrid is just an html table anyways, this seems like it should be easy but it's giving me a hard time. In ItemDataBound sub I'm trying to kick off javascript code using response.write(). The javascript code is contained within an IF block and if e.Item.Cells(0).Text = myVariable then the row gets hidden. A user can still view those rows later with a buttonclick. Only problem is, I aside from what I've described above, I...
1
1861
by: Fix_Metal | last post by:
Hello all. I'm new to this group :) I have a problem with javascript language. I'm making an .asp page with some integrated Javascript functions. The page consists of some HTML selects and a table. The table is obviously populated from a database :) so it is dynamic. The database contains a field containing some names. This field is not a PK, thus the names can be repeated very easily). I want the user to be able to see all the rows...
2
6717
by: Garg | last post by:
How do I hide a paricular tablerow during run time? I have two table rows with ids row1 and row2. I want that if a particualr condition is true, then row 1 should be displayed on the web page, otherwise row2 should be dispalyed. I tried following code, but it is not working: row1.Style.Value = "block" row2.Style.Value="None"
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10589
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10327
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.