Updating excel underpinning collection


#1

I have a simple experimental xp that binds an excel sheet to a pinboard of sticky notes. The position and size of the notes are bound to columns in the sheet along with the text of the note itself.

Now I want to persist any changes back to the sheet… I can see there is an action to update a row, but in order to update the row, one needs a row number relating to the collection object. I’m completely stumped as to where to obtain this from, since it doesn’t seem to be a property that can be bound to the template object (say to a hidden field)

Thanks, MT


#2

Hello mct,

You may want to test “Task Board” Sample in the Marketplace and check the associated article here.

From what i read, this sample is exactly doing what you want, especially the ID “trick” in Chapter §. About the Excel spreadsheet use to store task information.

Regards.

Alex.


#3

HI Alex - thankyou - but that does seem a bit convoluted! Surely it would make things a lot easier just to expose the row id in the binding so that it could be re-used at save time?


#4

Unfortunately, Excel isn’t a database and row number isn’t available in Excel Interface Asset because of Excel design limitation. You have to simulate yourself an “ID” column as shown in the Task Board sample linked above.

Reminder: in Excel, if you switch row 1 and row 2, the content will switch but they will still be named 1 and 2, same goes for columns A and B. It’s a spreadsheet, not a database :confused:

If you don’t want to manage IDs when you have to create/delete/update rows, you may want to have a look at Airtable which is a user-friendly database system, fully supported in Intuiface*.

* this article is currently being reviewed and an updated version detailing create/delete/update operations will be available in couple of days.


#5

Hmm… if row number is not available in the Excel IA, why does it want to use a “Row number” in the update row action?

I’d consider using Airtable except that involves subscription fees and off-site data which is all a bit messy even if the concept is neat. We already have some experience at building Dot Net IA classes so we might look at doing our own local database interface against some sort of super light weight DB… maybe something like http://www.litedb.org/

Cheers…MT


#6

99% of the time we use value “1” but we set a filter before in order to target a single row. We don’t expose it but we propose it for update/delete and advice to use in conjunction with filtering.