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