Datagrid Column editing

Pete pete at mollysrevenge.com
Wed Jan 18 20:19:40 EST 2012


Folks,
In case anyone needs to do this, here's how.

Put an OpenNextFieldEditor into your custom column behavior for the
datagrid.  This message is sent by the datagrid library when the user
presses the tab key in a column that is being edited.  If it is handled
then the datagrid does not carry out its default action which is to move
the the next editable column in the same row.

The trick is to send an EditCell message to the datagrid with the column
name and line number of the cell you want to open for editing next.  Which
cell that is will depend on your app of course but if you determine that
you are in the last editable column of the current row, it's pretty easy to
figure out the first editable cell of the next row and send the appropriate
EditCell message.

Pete



On Wed, Jan 18, 2012 at 10:36 AM, Pete <pete at mollysrevenge.com> wrote:

> I have a datagrid with three columns in it, col1 is not editable, col2
> contains an option menu and is also marked as not editable, col3 is a
> normal text column and is editable.
>
> If I double click on a cell in col3 to edit it, change the contents, then
> press tab, the cursor stays in the col3 cell.  I would have expected it to
> move to the next row of the datagrid, probably because I'm used to seeing
> spreadsheets and word processing tables work that way.
>
> I can probably figure out how to make this work by writing some code in a
> custom column behavior but thought I would check first to see if there is
> some hidden datagrid property that makes this happen.
>
>
> --
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
>
>
>


-- 
Pete
Molly's Revenge <http://www.mollysrevenge.com>



More information about the use-livecode mailing list