Newbie Data Grid question

Trevor DeVore lists at
Mon Dec 14 13:19:43 EST 2009

On Dec 14, 2009, at 1:11 PM, James Hurley wrote:
> It is heartening to see something defended by its parent. My sincere  
> apologies for treating your offspring in such a quick and dirty  
> fashion :-)

It's okay, the Data Grid likes to be beta up on once and a while :-)

The Data Grid is such a big departure from the other controls in  
Revolution that it can be tricky to get your head around it. The,  
shall we say, "less than x-talk" syntax you have to use doesn't help.

> FIrst to satisfy my quick and dirty needs, I find that the following  
> works well to get data displayed in a data grid field:
> on mouseUp
>   put field "data" into tData --Tab delimited text
>   --The first line of tData contains the column names
>   put line 1 of tData into tHeaders
>   replace tab with cr in tHeaders
>   set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to  
> Andre for this line.
>   set the dgText [ true ] of group "DataGrid" to tData
> end mouseUp

Yes, that is the way to approach it with a Data Grid. I should  
probably add that to a lesson somewhere...

> Now to reinforce your point about the richness of this more complex  
> object:
> In another context, I would like to be able to click on the first  
> column header and have it sort the grid by the LAST word of each in  
> the first column.
> Is it possible to access (and modify)  the script that the column  
> headers runs?

Take a look at this lesson:

How Do I Customize or Disable Column Sorting?: < 

> Thanks again for nursing us through the infancy of data grids.

More information about the use-livecode mailing list