CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 [RESOLVED] Show/hide link in a grid based on label value

Print topic Send  topic

Author Message
Dorin

Posts: 50
Posted: 02/05/2011, 7:56 AM

Hello,

I have a simple grid (InvoicesGrid) like this:

InvoiceId Status Link
1 0 -
2 1 Link2
3 1 Link3
4 0 -

All I want is to show the link on the Link column if the Status value is 1 and to hide it if the Status = 0.
I put the link in a panel (Panel1) and added the following code to Before Show Event of the panel:

if ($Container->status->GetValue() == "1") {
$Container->Panel1->Visible = True;
} else {
$Container->Panel1->Visible = False;
}

Although I tried:

if ($InvoicesGrid->status->GetValue() == "1") {
$InvoicesGrid->Panel1->Visible = True;
} else {
$InvoicesGrid->Panel1->Visible = False;
}

Both codes are not working. What I am doing wrong?

Any help?
Thanks
View profile  Send private message
damian

Posts: 838
Posted: 02/05/2011, 11:09 PM

Quote Dorin:
InvoiceId Status Link
1 0 -
2 1 Link2
3 1 Link3
4 0 -

All I want is to show the link on the Link column if the Status value is 1 and to hide it if the Status = 0.
I put the link in a panel (Panel1) and added the following code to Before Show Event of the panel:

if ($Container->status->GetValue() == "1") {
$Container->Panel1->Visible = True;
} else {
$Container->Panel1->Visible = False;
}

Although I tried:

if ($InvoicesGrid->status->GetValue() == "1") {
$InvoicesGrid->Panel1->Visible = True;
} else {
$InvoicesGrid->Panel1->Visible = False;
}

try

if ($Container->status->GetValue() =="1") $Container->Panel1->Visible = true;  
else if ($Container->status->GetValue() =="0") $Container->Panel1->Visible = false;

you might also have to use BeforeShowRow event...


_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
Dorin

Posts: 50
Posted: 02/05/2011, 11:52 PM

Thanks a lot Damian. It works like a charm.
View profile  Send private message
damian

Posts: 838
Posted: 02/06/2011, 12:52 AM

code or code + event?

_________________
if you found this post useful take the time to help someone else.... :)
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.