Derrick_DC wrote:
> Hi All,
>
> I am using CFGIRD with a pagesize of 25. However in some
cases the recordSet
> returned is less than 25 records and therefore the grid
will have blank space.
>
> Does anyone know if it is possible to dynamicaly change
the size of a cfgrid
> based on the number of records returned?
>
easy. in your cfc:
1) add <cfset var ps = arguments.pagesize> after the
arguments
declarations (assuming your argument that receives
{cfgridpagesize}
value is named pagesize)
2) assuming you have a query named myQuery which pulls the
data fro grid
from the db, add the following line AFTER the query: <cfif
myQuery.recordcount lt arguments.pagesize><cfset ps =
myQuery.recordcount></cfif>
3) your cfreturn line should then be: <cfreturn
queryConvertForGrid(myQuery, arguments.page, ps)
hth
--
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com