Flexiable Row heights in datagrid

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lumpo
Posts: 23
Joined: Sat Jan 05, 2008 1:14 pm

Flexiable Row heights in datagrid

Post by lumpo »

I am populating a DG from a number of custom props that contains 2 columns and 7 rows of text.For each line the amount of text is variable and so sometimes is within the space of the form field and others just disappears as it hits the field's lower limit (ie too much text).

IS is possible to have the rows dynamically adjust to the content of the field in the form? I am not using a fixed line height anywhere.

TIA
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: Flexiable Row heights in datagrid

Post by trevordevore »

Data Grid forms support variable height rows. Tables do not.

See this lesson for information on creating a variable row height data grid form.

http://lessons.runrev.com/spaces/lesson ... e-Heights-
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
lumpo
Posts: 23
Joined: Sat Jan 05, 2008 1:14 pm

Re: Flexiable Row heights in datagrid

Post by lumpo »

Thanks Trevor - figured it out and all's well... Sort of.
The rows all resize dynamically as data comes in (from a custom prop triggered from an rTree control) but I've lost the ability for a row to be highlighted. Clicking on the row allows me to extract data from the row ok. Have used DGH, intuition, human sacrifice, threats, promises and tears, but can't get the hilite ... Any suggestions?
Thanks
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: Flexiable Row heights in datagrid

Post by trevordevore »

The data grid will change the color of a graphic named "Background" in your row template (see notes in setProp dgHilite). Have you included a graphic with that name? Is it visible and opaque?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: Flexiable Row heights in datagrid

Post by Zryip TheSlug »

Plus, do you have a mouseDown handler in the datagrid group script?

If yes don't forget to pass the dgMouseDown message to the datagrid engine:

Code: Select all

on mouseDown pWhichButton
   doMyStuff
   dgMouseDown pWhichButton
end mouseDown
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
lumpo
Posts: 23
Joined: Sat Jan 05, 2008 1:14 pm

Re: Flexiable Row heights in datagrid

Post by lumpo »

Zryip TheSlug wrote:Plus, do you have a mouseDown handler in the datagrid group script?

If yes don't forget to pass the dgMouseDown message to the datagrid engine:

Code: Select all

on mouseDown pWhichButton
   doMyStuff
   dgMouseDown pWhichButton
end mouseDown
Zryip - thanks. an embarrassing forgetting to put the pass MouseDown in ... all's fine. Thanks for all the help guys
Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: Flexiable Row heights in datagrid

Post by Zryip TheSlug »

You're welcome :)
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
Post Reply