259 views
in Getting started by
Hi,

When i implement VerticalList.InvalidateItems, how can i know in the OnLoad Method that i came form this call?

1 Answer

+1 vote
by

Hi,

the approach is very simple. Typically it consists of following two steps:

Step 1: change the content in the data store (e.g. the value in the array) corresponding to the item.

Step 2: Inform the list that the content of the item is changed. Call InvalidateItems() for this purpose.

Let's assume you have a Vertical List displaying counter values from an array. Thus the array stores for every list item a number (the corresponding counter). Then, if you want one counter being incremented, the following code takes care of it and forces the list to reload the corresponding item:

// Step 1: In the data store: increment the counter corresponding to the 'item_number'
DataArray[ item_number ] = DataArray[ item_number ] + 1;

// Step 2: Force the list to refresh the item_number
VerticalList.InvalidateItems( item_number, item_number );

The following exampe demonstrates it:

http://ask.embedded-wizard.de/?qa=blob&qa_blobid=11221997628734759531

Does it help you further?

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...