Datagrid again

Trevor DeVore lists at mangomultimedia.com
Mon Jun 1 14:19:13 EDT 2009


On May 31, 2009, at 3:27 PM, Beat Cornaz wrote:

> While still discovering more on the wonderfull Datagrids, also more  
> questions have come up.
>
> I have a table Datagrid which gets filled up with data of different  
> lengths, containing numbers. Now I want to make the bottom  
> line(meaning the last record) in bold.
> It is the Totals all summed up. I started trying to set the first  
> fld (first column)in the bottom line to bold
>
>   put the dgNumberOfRecords of grp "Datagrid 3"  into maxNr	
>      set the textStyle of fld maxNr of grp "Datagrid 3" to bold
> ...

It is important to remember that the data grid recycles controls in  
order to only use as many controls as necessary to fill the visible  
area. This means that if you have 1,000 records there won't be 1,000  
controls.

All drawing that you perform should occur in the FillInData/ 
LayoutControl handler.

Just add something to the FillInData handler that checks if the line  
number of the current record is the total number of records.

on FillInData pData
     if the dgLineNo of me is the dgNumberOfLines of the dgControl of  
me then
         set the textStyle of me to "bold"
     else
         set the textStyle of me to empty
     end if
end FillInData

> Another thing I noticed is, that if I leave 1 line blank (so only a  
> cr in my data) and then have the line with the Totals, I can't  
> scroll all the way down. I am unable to reach the last line. I  
> solved this by putting in a 'space' on the empty line and then it  
> works. I was wondering why this is necessary.

I'm not familiar with this problem but if you put together a simple  
test stack and send it to me offlist I can take a look.

> I don't seem to find the way to change the border color of the  
> datagrid. In the group inspector, there is a lot of colors to be  
> adjusted, but not the border color.

I would file that one in the quality control center. You can just set  
the borderColor of group "DataGrid 1" to SOME_COLOR though.

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com



More information about the use-livecode mailing list