CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 hiding peices of a grid

Print topic Send  topic

Author Message
rvp032582

Posts: 47
Posted: 03/26/2006, 6:59 PM

hi. i need to be able to have a peice of a grid hidden, if there are nothing in that field.
for example a table is title, photo, caption, name. the user enters in data for all fields EXCEPT a photo. on the page this grid component is on, that data will appear and a broken image will appear (the box with red x).

does anyone know the code that would say that if there is no photo then to hide that portion of the grid only? i have tried:

If Properties1.PropPhoto.value Then
Properties1.PropPhoto.visible = FALSE
End If

that one didn't work. any suggestions are appreciated, thanks.
View profile  Send private message
mhope

Posts: 37
Posted: 03/26/2006, 9:19 PM

For an image I use 2 labels one just before the image data field and one just after and use an If condition as follows:

If users.MainImage.Value = "" Then
users.MainImgShow.Value = "No photo"
users.MainImgShowEnd.Value = ""
Else
users.MainImgShow.Value = "<img src=""memPic/"
users.MainImgShowEnd.Value = """ height=""75"">"
End If
I place the MainImgShow just before the image data field and the MainImgShowEnd so if there is a value in the image data field the labels turn into an image tab else the first lable simply says “No Image”

Hope this helps
View profile  Send private message
mhope

Posts: 37
Posted: 03/26/2006, 9:20 PM

Oh and the image data field should be a label too
View profile  Send private message
zolw


Posts: 51
Posted: 03/27/2006, 8:42 AM

Why don´t you try this?

Don´t add the image as an image, but as a label (you can change the type using right click on the image and chhosing "Cange To - Label)".
Then change the "Content" property in the label to HTML instead of text.

Then on "Before Show" for that label you add something like this.
Assuming the grid is called "pictures" and the label is called "photo" and the path to the image files is "images/".

If pictures.photo.value <> "" Then
picture.photo.value = "<img src=""images/" & pictures.photo.value & """>"
Else
picture.photo.value = "No picture"
End IF
_________________
Zolw
http://www.xlso.com
View profile  Send private message
marcwolf


Posts: 361
Posted: 03/27/2006, 2:39 PM

I used zolw's suggestion many times for images and links.

Sometimes its best when you have either a complex link or a image that you want to manipulate the visibility on.

The HTML properties of the label can be extremely useful as it can let you fine tune your applications visibility.

Take Care

Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.