repeater
Source code

Welcome to Repeater View Examples

[go back]

Selected Contact: No Contact Selected
This example demonstrates the use of ReuseIfModelsEqualStrategy implementation of IItemReuseStrategy interface for the dataview. IItemReuseStrategy is responsible for how the child item components of the dataview are recycled between requests. The default strategy simply discards all previous items. The ReuseIfModelsEqualStrategy strategy will keep items if the model of the item matches one of the models that is to be displayed in the current request - this allows reuse of items that did not leave the page. This is useful when there is a need to keep state across requests for items that are visible within the page. Notice that when you click the 'toggle highlite' link the item stays highlited until it leaves the page or you click the link again. If the default strategy would have been used instead, the item would not have been highlited because it would have been replaced by a new item and thus would not have known that it should be highlited.

<< < 1 2 3 4 5 6 > >>
Actions ID First Name Last Name Home Phone Cell Phone
select toggle highlite 50 Abby Wilson 411-555-2343 388-555-4583
select toggle highlite 17 Brianna Smiith 864-555-6680 260-555-4216
select toggle highlite 27 Brianna Moore 431-555-1267 827-555-5515
select toggle highlite 43 Christopher Clark 285-555-1554 385-555-2240
select toggle highlite 47 Christopher Nelson 430-555-8555 306-555-4504
select toggle highlite 7 Debra Moore 732-555-3268 370-555-6101
select toggle highlite 14 Debra Graham 834-555-5776 315-555-8080
select toggle highlite 3 Douglas Murray 600-555-7742 713-555-1485