Datagrid - Style Table - single line height reduced

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
hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Datagrid - Style Table - single line height reduced

Post by hilton » Mon Dec 29, 2014 10:33 am

Hi,
I am using a Datagrid with style being Table. I have set the height of each row to 60. The row data is 3 lots of string data separated by crlf. So far so good. If I have more than one row of data to display all of the rows display fine, however, if there is only one row to display only the first lot of data is displayed ie up to the first crlf. If I then select that row, only the portion that is displayed is highlighted. As soon as there is a second row to display, the behaviour corrects itself. It is almost as if the height of a row is reduced when there is only one row to display.

I am puzzled, as I am new to Livecode I am probably doing something wrong. Any ideas?

Thanks,
Hilton.

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

Re: Datagrid - Style Table - single line height reduced

Post by Klaus » Mon Dec 29, 2014 4:06 pm

Hi Hilton,

1. welcome to the forum!

2. Congratulation, you chose the most complex LC object to start with, the DATAGRID :D

3. Datagrids of type TABLE are supposed to display ONLY ONE line of text in each cell/line!
If you want multiline text display, you need to use a datagrid of TYPE FORM, which is even more complex.


Best

Klaus

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Datagrid - Style Table - single line height reduced

Post by hilton » Tue Dec 30, 2014 8:22 am

Thanks Klaus.
I will move on to the Datagrid - Form Style. However, it still seems strange that when there is only one line it displays partially, but as soon as there are two both display just fine.

Anyway, it will be good experience to try to conquer then Form Style.

Thanks again,
Hilton.

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

Re: Datagrid - Style Table - single line height reduced

Post by Klaus » Tue Dec 30, 2014 11:36 am

Hi Hilton,

load the datagrid documentation PDF here and work through the examples:
http://lessons.runrev.com/m/datagrid
Datagrid FORMS are very, very complex to master, took me AGES :D

Hint:
Do not use CRLF internally in Livecode, replace it with CR before displaying data in Livecode.
May show unwanted results when using cross platform -> Mac/Win.


Best

Klaus

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Datagrid - Style Table - single line height reduced

Post by hilton » Tue Dec 30, 2014 1:26 pm

Hi Klaus,

I have figured out a way around the strange behaviour and it works fine.

Thanks for the tip on crlf.

I have some apps written in a competing language and I am trying to convert/rewrite one of them in LiveCode. The reason I am trying LiveCode is that having one code base for Android and iOS has a great deal of appeal. The competitive product requires two sets of code. I will delay trying the FORM style of DataGrid as I am keen to finish the Android Version and then try it on iOS and see what, if any, issues exist.

I am going to go through the courses that become available from January 5th to make sure that I give LiveCode a fair go.

Many thanks for your help,
Hilton.

Post Reply