473,802 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding table rows at run time in vb.net

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.Valu e = "block"
row2.Style.Valu e="None"

But, still both the rows are being displayed. How do I achieve the
desired functioanlity of hiding one row while displaying teh other row
at run-time.

Please help me with this....

Feb 15 '07 #1
2 6716
On Feb 15, 8:15 am, "Garg" <shivaniga...@g mail.comwrote:
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.Valu e = "block"
row2.Style.Valu e="None"
row1.Style.Add( "display", "none"); for instance...!
But for this operation you would normally want to build that table
dynamically and then DON'T build the rows that's not supposed to be
shown...
Preferable with some Ajax Framework...!!

..t

--
http://ajaxwidgets.com
Free ASP.NET Ajax Widgets NOW!

Feb 15 '07 #2
row1.Style("dis play")= "none"

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Garg" <sh**********@g mail.comwrote in message
news:11******** *************@j 27g2000cwj.goog legroups.com...
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.Valu e = "block"
row2.Style.Valu e="None"

But, still both the rows are being displayed. How do I achieve the
desired functioanlity of hiding one row while displaying teh other row
at run-time.

Please help me with this....

Feb 15 '07 #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
1552
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> <!--//
5
2174
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...
2
2226
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups of searchable fields in the fields 3. Each group can be expanded/collapsed by clicking on a link "(Fewer|More) Options" which sits right next to the group title.
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
3624
by: chris f | last post by:
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...
5
4961
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html Here is some jquery js that I think...
0
9562
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
10536
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...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
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
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
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...
1
4270
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
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.