Where is the detailed doco for LiveCode datagrid?

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
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Where is the detailed doco for LiveCode datagrid?

Post by BarrySumpter » Mon Aug 08, 2011 12:05 am

I just finished my research on the basic table field.
I had deduced that the basic table field was so "very basic" that it didnt' get a mention in the dictionary.

I was suprised to find that the DataGrid isn't mentioned in the dictionary either.

However, I did find a excellent start on the datagrid here:

LiveCode | User Samples | Data Grids Tour

and here as well:

7343-Data-Grid-Properties
http://lessons.runrev.com/spaces/lesson ... Properties

----

The very first scipt has to do with the datagrid property of "header text style":

Code: Select all

set the dgProps["header text style"] of group "DataGrid1" to "normal"
Is there any detailed doco on the other settings for "header text style" property of the DataGrid?
i.e. "not-normal", "super-normal", etc.

Along with detailed doco on other properties for the DataGrid?

Is there a way to enumerate the possible values in "header text style" property of the DataGrid
using the Message Box as with other objects?
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Where is the detailed doco for LiveCode datagrid?

Post by SparkOut » Mon Aug 08, 2011 12:23 am

http://lessons.runrev.com/spaces/lesson ... s/datagrid is the root for a wealth of information about the datagrid. Also on the right hand pane you will see the link to download the datagrid pdf manual.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Where is the detailed doco for LiveCode datagrid?

Post by BarrySumpter » Mon Aug 08, 2011 12:27 am

Wow! That should keep me busy for about a month.

I'll have to see if there is any detailed doco to the "Header text style" property.

Many thanks
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

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

Re: Where is the detailed doco for LiveCode datagrid?

Post by Klaus » Mon Aug 08, 2011 12:28 pm

DocO? 8)

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Where is the detailed doco for LiveCode datagrid?

Post by BarrySumpter » Tue Aug 09, 2011 12:54 am

Just a first effort quick n dirty DataGrid project I'll be using as a quick start cheat sheet.

Create a new mainstack
add a datagrid control
and rename the datagrid control to DataGrid2
Mostly just a practical use quick start - with a couple o gotchas.

I kinda like it when I add data with no headers the headers are built for me.

Still enjoying researching the DataGrid.
Attachments
DataGrid1.zip
(5.29 KiB) Downloaded 249 times
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

DataGrid AutoSize Column Widths

Post by BarrySumpter » Tue Aug 09, 2011 1:50 am

DataGrid AutoSize Column Widths
http://forums.runrev.com/phpBB2/viewtop ... 773#p41773

Now we're talkin!

Very cool!

Code: Select all

Command dgAutoSizeColumnWidth
   
   local theColWidthsA ## when all done has a key for each column name. Value of key is max width.
   
   put the dgData of group DataGrid2 into theDataA
   put the dgIndexes of group DataGrid2 into theIndexes
   put the dgProps["columns"] of group DataGrid2 into theColumns
   
   ## Loop through all records
   repeat for each item theIndex in theIndexes
      ## Loop through each column of record
      repeat for each line theColumn in theColumns
         ## Figure out width of this record's column
         set the text of field "FigureOutWidth" to theDataA[theIndex][theColumn]
         put max(the formattedwidth of field "FigureOutWidth", theColWidthsA[theColumn]) into theColWidthsA[theColumn]
      end repeat
   end repeat
   
   ## Reset field
   set the text of field "FigureOutWidth" to empty
   
   ## Set column widths
   repeat for each line theColumn in theColumns
      put theColWidthsA[theColumn] & comma after theWidths
   end repeat
   
   delete the last char of theWidths
   set the dgProps["column widths"] of group DataGrid2 to theWidths
   
   ## output max widths for testing purposes
   repeat for each line theColumn in theColumns
      put "max width for column" && theColumn & ":" && theColWidthsA[theColumn] & cr after theText
   end repeat
   
    put theText  -- into IT
    
end dgAutoSizeColumnWidth
  
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

davidedynamicsGA45ff
Posts: 47
Joined: Mon Dec 19, 2011 1:11 pm

Re: Where is the detailed doco for LiveCode datagrid?

Post by davidedynamicsGA45ff » Sun Jan 29, 2012 9:26 pm

Thanks Barry, for the scripts.
cheers David

Post Reply