2 Data Grid questions

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
r_houdek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Wed Feb 23, 2011 1:35 am

2 Data Grid questions

Post by r_houdek » Mon Apr 18, 2011 4:07 am

I have 2 questions about data grids. Any help would be appreciated!

1. Is it possible for a data grid table to word wrap? I'm building a bunch of tables and the column names are sometimes long. It would be great for the column headers to word wrap and grow taller automatically. Any ideas?

2. Is there a function to determine the best width for a data grid table column? In Java there's a FontMetrics object that can tell you how many pixels wide a string will be. I'd like to find a function like this in LiveCode to determine how to set column widths.

Thanks so much,

Ritch

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

Re: 2 Data Grid questions

Post by Klaus » Mon Apr 18, 2011 10:08 am

Hi Ritch,

1. sorry, no idea.
2. you can check "the formattedwidth of fld X"!
I think this is what you are looking for.


Best

Klaus

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: 2 Data Grid questions

Post by Steve Denney » Tue Apr 19, 2011 11:30 pm

Hi Ritch, re: 1...

I'm assuming you're displaying the data for the user (pretty safe bet). The answer will depend on how you've designed your app: You've got a field for the data and a separate fld for the header? Or flds for the column headers and each and every column? (my personal fav). If you're trying to show everything in a single fld you might have problems, especially if you want to do anything more than display the data i.e. let the user select rows or records.

But all are do-able.
Steve

Post Reply