Page 1 of 1

2 Data Grid questions

Posted: Mon Apr 18, 2011 4:07 am
by r_houdek
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

Re: 2 Data Grid questions

Posted: Mon Apr 18, 2011 10:08 am
by Klaus
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

Re: 2 Data Grid questions

Posted: Tue Apr 19, 2011 11:30 pm
by Steve Denney
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