A DataGrid is not a spreadsheet
Paul Dupuis
paul at researchware.com
Fri Jul 29 17:25:27 EDT 2016
The default behavior of a Datagrid is a table (or column) view (vs. the
Form view Datagrid can also do). In that default mode, the default is
that clicking in a cell will edit the contents
However, when you drag a Datagrid control to a card, the default is that
there are no rows and no columns until you add some. Just as an example,
if you wanted a 10 row x 5 col "blank" editable table a user could put
data into, you need to create the 5 empty columns and 10 rows.
You can do this in the property inspector for the the data grid. In the
popup list of property panes (pre-LC8), select Columns and add some
columns by clicking the small plus sign button. Their default names will
be Col1, Col2, etc. To add "rows". Add 5 of them. Then Select the
Content pane in the Property Inspector and add 10 blank lines (enter 10
return characters). This creates 10 empty rows in the data grid.
Close the property inspector and select the browse tool and click on one
of the 50 cells (10 rows by 5 columns) and type in data. At any time to
see a text view of the data (as tab and return delimited data), open the
Message Box and enter
put the dgText of group "<the name of you data grid object>" into msg
and press return.
Try it.
On 7/29/2016 4:55 PM, Graham Samuel wrote:
> Do you mean that a standalone can allow text to be entered in cells like in a spreadsheet without further coding? Obviously one would need scripting to add spreadsheet-like functions such as arithmetic operations; and to extend the functionality to manipulation of formulae would be a major task. But just being able to “click in an empty cell and enter data” would be a good start.
>
> I have always tried not to use Datagrids as the seem to me so extraordinarily complicated. But if one were to write a “simplified spreadsheet” widget, would a Datagrid be the place to start? In a way I suppose the web of functionality in a Datagrid makes it a kind of proto-widget.
>
> Curious
>
> Graham
>
>> On 29 Jul 2016, at 21:57, Paul Dupuis <paul at researchware.com> wrote:
>>
>> On 7/28/2016 10:24 PM, Javier Miranda V. wrote:
>>> Dear friends, is it safe to say that a data grid is not a spreadsheet? I mean, you can not create a new data grid and then just click in a empty cell and enter data.
>>>
>>> With some practice and reading documentation, I am able to populate a datagrid with data from a database, and using a Table field in situation in which the user must fill-in data seems limited.
>>>
>> Yes, a Datagrid can be used much like a Spreadsheet. If you create a new
>> data grid on a card, you need to bring up the property inspector and add
>> some columns ay 5 columns) and add some blank rows (say 10 cr's (i.e. 10
>> blank lines)) to the content property. If you then close the property
>> inspector and select the run tool, you can click in any cell of the 10r
>> x 5c spreadsheet you made and enter data.
>>
>> You can fetch the data as tab and return delimited text by getting the
>> dgText propert of the group that is the datagrid OR as an array by
>> getting the dgData property.
>>
>> You do need to add some external controls to add rows and column OR sort
>> of like excel, you could prepopulate it with 65535 blank rows and 676
>> columns (A - ZZ) and trim off the blank columns and row on the right and
>> bottom when you want to fetch the data.
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list