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

 Code to Hide/Show and Image vb.net

Print topic Send  topic

Author Message
sgadson

Posts: 45
Posted: 09/01/2004, 8:45 AM

Hello,

Can someone please tell me the custom code in vb.net to hide or show an image based on weather a field is null or has a value.

For example: If the field value is Null, then I do not want to see the image. If the field has any value in it ,I want to see the image.

Thanks
_________________
Shawn :-)
View profile  Send private message
Stan
Posted: 09/01/2004, 11:31 PM

Hi Shawn

You could try the following code in the BeforeShow event of Image control

For the Record form

<FormName><ControlName>.Visible = Not IsNothing(Item.ControlName.Value)

For the Grid, EditableGrid

<FormName><ControlName>.Visible = Not IsNothing(DataItem.ControlName.Value)

Stan
DonB
Posted: 09/06/2004, 1:23 PM

Checkmark the Image's "Extended HTML" property, to give the image a Visible
property that can be set True or False. Until it's "extended", this
property is not available and you can't hide it.

--
DonB

http://www.gotodon.com/ccbth


"sgadson" <sgadson@forum.codecharge> wrote in message
news:84135eea43a8ff@news.codecharge.com...
> Hello,
>
> Can someone please tell me the custom code in vb.net to hide or show an
image
> based on weather a field is null or has a value.
>
> For example: If the field value is Null, then I do not want to see the
image.
> If the field has any value in it ,I want to see the image.
>
> Thanks
> _________________
> Shawn :-)
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

sgadson

Posts: 45
Posted: 09/07/2004, 7:48 AM

Hi Stan,

The code you suggested worked great, however now the actual image does not show. What does show is a broken image tag. So if there is something in the field I get the broken image tag and if there is nothing in the field it is blank.

This is VERY close to what I need. I just need to know what I am doing wrong. Here is my BeforeShow code:

L_MA11_Main_Data_tblLocation.Visible = Not IsNothing(DataItem.Location.Value)

Not sure if this helps, but here is the html:

<td class="LightWalkDataTD">
<p align="center"><a class="LightWalkDataLink" href="{Location}"><img class="LightWalkInput" src="icon_search.gif" border="0"></a></p>
</td>


Any ideas?
_________________
Shawn :-)
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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