Page 1 of 1
wrap text in datagrid table
Posted: Thu Aug 28, 2014 2:04 pm
by francof
Hi all,
I'm new in LC and much more in datagrid... I'm reading the LiveCode_Data_Grid.pdf guide and found out a lot of intersting things about it.
I use a datagrid table in my code, to only show some data. due to the width of the card, the colums can't show all the text of some fields.
this lesson
http://lessons.runrev.com/s/lessons/m/d ... ne-heights
would seem to make my case, but it refers to a datadrid form.
I do not understand the difference between table and form datagrid. I'm not sure if I can use it.
the "Script Field to Resize to Fit Height" in the lesson refer to some item (3, 4) ?? I would not want to mess up
thanks for your help
franco
Re: wrap text in datagrid table
Posted: Thu Aug 28, 2014 3:06 pm
by sritcp
Hi Franco:
You can set the row height of a table, but it will be the same for all rows.
You can individualize the row height in case of a form -- that was the lesson you referred to.
In a table, you control the data grid at the level of a column (you can customize a specific column by editing its behavior template).
In a form, the basic control is the row template; you cannot customize column behavior except through the row template.
When you are laying out the row template, you need to manipulate its dimensions. You do it by using its "rect".
Rect has 4 "items", corresponding to the four corners of the rectangle. These are the items that you asked about.
See dictionary for more details.
When using data grid, it's best to tread with care. Just my opinion.
Regards,
Sri
Re: wrap text in datagrid table
Posted: Thu Aug 28, 2014 8:32 pm
by francof
ciao Sri,
sritcp wrote:Hi Franco:
You can set the row height of a table, but it will be the same for all rows.
Yes I've set the row height of the columns but, but the display of the text is not changed.... boh
sritcp wrote:....When using data grid, it's best to tread with care. Just my opinion.
Regards,
Sri
I've already heard this claim..

for this I would not to use too much that object. even if it is really handy.
best
franco
Re: wrap text in datagrid table
Posted: Fri Aug 29, 2014 3:03 am
by dunbarx
Sri did not mean a dataGrid is unstable or psychotic, only that it is complex, and requires considerable effort to master. This after one is already fairly conversant with LC itself, It has its own "language" and behaviors, even though it is strictly built in LC.
Craig Newman
Re: wrap text in datagrid table
Posted: Fri Aug 29, 2014 8:20 am
by francof
dunbarx wrote:Sri did not mean a dataGrid is unstable or psychotic, ...
me too.
dunbarx wrote:..., and requires considerable effort to master. ...
for this I have not used yet it. it's very complex and useful. I use datagrid for the first time in the simplest way possible.
franco
Re: wrap text in datagrid table
Posted: Fri Aug 29, 2014 11:18 am
by keram
Hi Franco,
I found that a very good way to learn to use Data Grid is to look through the existing examples.
Here you'll find few ones that I found very useful:
StarterKit and DGForms :
http://forums.livecode.com/viewtopic.php?f=7&t=20130
and also:
http://forums.livecode.com/viewtopic.php?f=7&t=15540
and
http://forums.livecode.com/viewtopic.php?f=7&t=7865
keram
Re: wrap text in datagrid table
Posted: Fri Aug 29, 2014 6:13 pm
by francof
Hi keram,
thanks for the info. I had already consulted StarterKit, the other are new for me.
franco
Re: wrap text in datagrid table
Posted: Sat Aug 30, 2014 5:17 pm
by Klaus
Buongiorno Franco.
a datagrid of type TABLE can only display ONE line of information per column/row.
If you need more, you need to create a datagrid of type FORM.
Read and check the examples in the Datagrid PDF here:
http://lessons.runrev.com/m/datagrid
Best
Klaus
Re: wrap text in datagrid table
Posted: Sat Aug 30, 2014 5:47 pm
by francof
Hi Klaus,
Klaus wrote:Buongiorno Franco.
a datagrid of type TABLE can only display ONE line of information per column/row.
If you need more, you need to create a datagrid of type FORM.
...
yea, after trying for a long time, I realized that it is so.

I prefer use the more light 'table'
I also download the Manual PDF for data grid, very useful.
thanks. ciao
franco