saseow
Posts: 744
|
| Posted: 08/24/2010, 3:55 AM |
|
I want to put a text field in an editable grid within a Panel but only show it for the last row.
Any ideas how to get the last row and then show the Panel?
I am stuck!
|
 |
 |
Waspman
Posts: 948
|
| Posted: 08/24/2010, 5:32 AM |
|
count the rows, compare it with total number of records, set a session variable when equal, show panel accordingly
_________________
http://www.waspmedia.co.uk |
 |
 |
saseow
Posts: 744
|
| Posted: 08/24/2010, 5:55 AM |
|
Hi Waspman,
Ok, this sounds reasonable. I can do all of that. Perhaps there is a better way to count rows but this is how I will do it. Any better suggestions, please don't hesitate:
Add a hidden field and update it with a session variable+1. Good?
Thanks Waspman. Really appreciate it!
|
 |
 |
Waspman
Posts: 948
|
| Posted: 08/24/2010, 6:13 AM |
|
yep that will do it, only just add it to the session, no need for the hidden field.
_________________
http://www.waspmedia.co.uk |
 |
 |
saseow
Posts: 744
|
| Posted: 08/24/2010, 6:20 AM |
|
Excellent! Thank you very much.
I will do this tonight and let you know the result.
Really appreciate it! Thanks.
|
 |
 |
rho
Posts: 85
|
| Posted: 08/24/2010, 9:49 AM |
|
Just my two cents: for counting rows, I use a global variable (at the top of the *_events.php):
$row = 0;
And in the BeforeShowRow() event of the grid, I increment the row counter:
$row+=1;
To show/hide your panel, you can then use something like this in the BeforeShowRow() event:
$sender->MyPanel->Visible = ($row<$numrecords);
Where and how you determine $numrecords depends on your grid implementation.
Cheers, Rob.
|
 |
 |
saseow
Posts: 744
|
| Posted: 08/24/2010, 9:35 PM |
|
Thanks Waspman and thanks Rob!
Works perfectly!
|
 |
 |
|