Overwriting data grid

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
croivo
Posts: 111
Joined: Wed Feb 26, 2014 11:02 pm

Overwriting data grid

Post by croivo » Tue Jul 28, 2015 11:54 am

How to overwrite certain cell in data grid if it's already filled with text?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Overwriting data grid

Post by dunbarx » Tue Jul 28, 2015 1:41 pm

Hi.

Datagrids are complex. Changing the value of a "cell", whether already containing data or not, is not as straightforward as doing so in a field.
There are two ways, and you should read about each in the DG User Guide. Check out the "dgData" and the "dgText" properties. Write back if you have problems.

Craig Newman

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Overwriting data grid

Post by MaxV » Tue Jul 28, 2015 4:44 pm

I sugget you to read this: http://livecode.wikia.com/wiki/Datagrid_API
It contains all properties and hidden functions to work with datagrid.
A lot of them aren't in the dictionary.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: Overwriting data grid

Post by sritcp » Tue Jul 28, 2015 5:04 pm

croivo wrote:How to overwrite certain cell in data grid if it's already filled with text?
1. If you need to do it manually, then you can simply double-click on the cell (in a datagrid "table") and edit it.

2. If you need to do it by script, use either setDataOfIndex or setDataOfLine command, directed at the datagrid.
If you are giving this command from outside the datagrid script, then send this command by using DISPATCH or SEND.
For example,

Code: Select all

dispatch "setDataOfIndex" to group "myDataGrid" with tParameterList
where tParameterList is a comma-separated list giving the values: pIndex,pKey,pValue

The above commands are described in the datagrid user guide (link given in an earlier message on this thread).

Regards,
Sri

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Overwriting data grid

Post by dunbarx » Tue Jul 28, 2015 7:38 pm

either setDataOfIndex or setDataOfLine command, directed at the datagrid.
Sri is correct if you only want to change a single "cell" or a single line. Do practice all the suggestions. You will surely use them all.

Craig

Post Reply