Listbox inline editing event handler?

I have made my single column listbox inline editable.

The question I have is:
Which event do I need to use for when the user has finished editing the row - and also, does that event know which row was edited?

The user clicks on row 36 and inline edits the text content of that cell.
How do I then determine which cell was edited, so that I can create code to be executed after this editing is complete?


look into the CELLACTION event

Thanks Dave.
So the CellAction event is where I put the code to be executed after the user has finished editing - Cool, thanks.

The only part I am now not sure about is how to determine which row was edited?

The user could edit any cell from an unlimited number of rows - so I can’t really use an if / else statement, as I do not know how many rows there will even be?

This part has me stumped, as this is the very first time I have looked into using inline editable listbox cells :frowning:

Basically - the cell content gets populated from a database - so when the user inline edits a cell - I need to re-save that edited text back into the database column from which it came.

Hope that makes sense.


uh… the ROW and COLUMN passed by the event

read the LR is has examples…

I have read it - but I do not understand it :frowning:
I cannot work out how to save the newly edited content back into the database column from which it was originally populated.

Thanks anyway Dave - I appreciate you trying to help :slight_smile:

That was not your question… you asked how to know what Listbox row/column was edited, and when edit was complete. It is up to you to store information (perhaps ROWTAG or CELLTAG) that indicates where you need to put the data

EVENT CELLACTION(row as integer,column as integer) // called when a cell edit completes
   dim newValue as string=me.cell(row,column) // this is the newly entered value
   // assuming database column was stored in CELLTAG and ROWTAG as "where data"
   dim SQL as string="UPDATE myTable SET "+me.celltag(row,column)='"+newValue+"' WHERE "+me.rowtag(row,column)
  // execute the SQL

Up to you to figure out what you need to keep about your database in order to do this succesfully.

Thanks Dave - the line of code below, from your post above makes it much easier to comprehend:

dim newValue as string=me.cell(row,column)

I can probably get this to work now.

Thank you!

If you are populating the listbox from an original database select statement then I would store the database unique key (possible rowid) in the listbox RowTag. Then, following the edit and in the CellAction event you can read back the unique db id from the RowTag(row) field so that you can Update the database.


Thanks Simon.
I will look into this and report back :slight_smile:

This happens to me too. I follow wrong streets WHILE reading the docs until someone gaves me the right way (to activate inline editing). *

  • That and because I was stressed by the time, I added a window to edit each Row… in a three years ago pro-bono project.