DataGrid and my headache

Mark Wieder mwieder at ahsoftware.net
Fri Sep 2 20:40:17 EDT 2011


Horst-

Friday, September 2, 2011, 12:49:17 PM, you wrote:

> It would be so kind, if you'll be able to kick me in the right
> direction.

The example is incomplete (aka "wrong"). Try the following... the
inserted text is from the more complete example at

http://lessons.runrev.com/s/lessons/m/datagrid/l/36470-How-do-I-create-a-Datagrid-dynamically-from-tab-delimited-data

on mouseUp pMouseBtnNo
    local theText
    local firstLineContainsColumnNames
    local theColumns
    
    put "state" & tab & "code" & cr & \
            "ALABAMA" & tab & "AL" & cr & \
            "ALASKA" & tab & "AK" into theText
    
    --create columns
    put line 1 of theText into theColumns
    --no empty column names are allowed, so I insert a space when that happens
    replace tab & tab with tab & " " & tab in theColumns
    replace tab with return in theColumns
    set the dgProp["columns"] of group "DataGrid 1" to theColumns
    
    put true into firstLineContainsColumnNames
    set the dgText[firstLineContainsColumnNames] of group "DataGrid 1" to theText
end mouseUp

-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list