#
dave.geary
I'm trying to develop a module in which the admin page displays a list of items very similar to the sections table on the NodeEdit admin page. That is, each item has up/down buttons to move it in the list, plus edit and delete links. However, unlike the NodeEdit page, the items need to be cached across postbacks since it's only written to the database when the user finally clicks a Save button.
The problem is that I'm databinding a gridview with an IList containing my item objects, but those items are not available on postback. The gridview must be caching the underlying data somehow because it's redisplayed on postbacks, but I don't have any way of accessing that, to my knowledge (the DataSource property is null during postbacks).
I've tried caching the IList in viewstate, but that won't work because my class has a Section property and the core Section class isn't marked as serializable.
So, is there a recommended way to hold in-memory changes across postbacks or might I be missing something obvious for accessing the gridview's datasource on a postback?
Thanks,
Dave.
The problem is that I'm databinding a gridview with an IList containing my item objects, but those items are not available on postback. The gridview must be caching the underlying data somehow because it's redisplayed on postbacks, but I don't have any way of accessing that, to my knowledge (the DataSource property is null during postbacks).
I've tried caching the IList in viewstate, but that won't work because my class has a Section property and the core Section class isn't marked as serializable.
So, is there a recommended way to hold in-memory changes across postbacks or might I be missing something obvious for accessing the gridview's datasource on a postback?
Thanks,
Dave.