changing from a table to a datagrid

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
melhiatt
Posts: 68
Joined: Wed May 25, 2011 9:17 am

changing from a table to a datagrid

Post by melhiatt » Wed Aug 24, 2011 1:43 am

I have a table set up and want to switch to a datagrid. I have a filter set up in a field for my current table:

filter field "info" with "*" & field "First" & "*"& tab & "*"

that works great.

When I change to a datagrid with the same name and try this code to filter:

filter group "info" with "*" & field "First" & "*"& tab & "*"

it doesn't work. What am I doing wrong?

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: changing from a table to a datagrid

Post by Klaus » Wed Aug 24, 2011 12:00 pm

Hi mel,

a DataGrid is NOT a field (but a very complex best and not really beginners stuff!),
so you cannot use "filter" here directly.

Please check the PDF from the URL that someone posted in your other threads, it
is very important to re-create and understand every example in the DataGrid docs PDF.

Get it here:
http://lessons.runrev.com/s/lessons/m/datagrid


Best

Klaus

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: changing from a table to a datagrid

Post by bangkok » Wed Aug 24, 2011 1:16 pm

-Use the filter command... on a variable

-then inject the variable into the datagrid

Code: Select all

filter myResult with "*" & field "First" & "*"& tab & "*"
put false into pFirstLineContainsHeaders 
set the dgText [ pFirstLineContainsHeaders  ] of group "myDataGrid" to myResult

Post Reply