sanit
|
| Posted: 04/30/2005, 7:35 AM |
|
Dear,
I want to display row counter in grid column by variable and I found sample in rexdesign below :
Row Counter in CCS :
Insert Label (Toolbox-Form-Label) where you need the number
Name it myLabel (just for example)
Add Event BEFORE SHOW for this Label
Use code below (PHP but the logic is easy in any language)
//BEGIN CUSTOMCODE
global $myGridName;
global $myCounter;
if (empty($myCounter)) {
$myCounter = 1;
} else {
$myCounter++;
}
$myGridName->myLabel->SetValue($myCounter);
These code work for display row counter each page,Example page size = 15 ,display row counter 1 to 20 every page.But I need to display row counter continue until end of file not reset to 1 for new page.Please help me any idea.
Thanks in advance,
Sanit.
|
|
|
 |
sanit
|
| Posted: 05/01/2005, 8:17 AM |
|
I found the way to get pagesize and pagenumber to calculate row number.Thank you.
Sanit.
|
|
|
 |
PeterJ
Posts: 90
|
| Posted: 05/01/2005, 8:50 AM |
|
Would you post the solution please to assist others?
Thanks
|
 |
 |
sanit
|
| Posted: 05/01/2005, 7:28 PM |
|
Dear peterj,
Below is my coding in before show row of grid "asset_master" and I extend idea from rexdesign.I wish .0 have feature row ID.
global $nr;
$n=CCGetFromGet("asset_masterPage");
$p=$asset_master->PageSize;
if($n<=1){
if(empty($nr)){
$nr=1;
}else{
$nr++;
}
}else{
$no=(($n*$p)-$p);
if(empty($nr)){
$nr=$no+1;
}else{
$nr++;
}
}
$asset_master->Label1->SetValue($nr);
Sanit.
|
|
|
 |
sanit
|
| Posted: 05/01/2005, 7:38 PM |
|
Dear peterj,
Here is complete reply.
Below is my coding in before show row of grid "asset_master" and I extend idea from rexdesign.I wish .0 have feature row ID.
global $asset_master;
global $nr;
$n=CCGetFromGet("asset_masterPage");
$p=$asset_master->PageSize;
if($n<=1){
if(empty($nr)){
$nr=1;
}else{
$nr++;
}
}else{
$no=(($n*$p)-$p);
if(empty($nr)){
$nr=$no+1;
}else{
$nr++;
}
}
$asset_master->Label1->SetValue($nr);
Sanit.
|
|
|
 |
PeterJ
Posts: 90
|
| Posted: 05/02/2005, 1:11 AM |
|
Many thanks Sanit
|
 |
 |