I'm trying to set available columns as a list and allow callers to make them visible at run-time. Maybe I'm trying to do too much with the available tools, but my approach is much preferred over traditional report parameters for the following reasons:
1. I can define columns programmatically and make them available as a list to the callers without the caller having to know the column names at compile-time.
2. Callers can choose which columns to make visible, change the size, etc at run-time.
So basically I have a List<ReportColumn> collection and a List<SortableColumn> collection. I populate these collections in the report constructor.
I then bind a checkbox list in the caller to allow the user to specify which columns to show. I also bind a drop-down to allow the user to pick which column to sort on.
I then have methods ShowHideColumn(string key, bool visible) and SetSortColumn(string key, SortDirection direction) available for the caller to chose which columns to show and sort by.
My problem is that setting these properties on the list are simply wiped away the next time the constructor is run. Is there a way to preserve these values. Web caching perhaps? I'd rather not use caching if there is a better way to preserve them, but i will do what i have to to preserve the binding functionality.
Thanks,
Scott
1. I can define columns programmatically and make them available as a list to the callers without the caller having to know the column names at compile-time.
2. Callers can choose which columns to make visible, change the size, etc at run-time.
So basically I have a List<ReportColumn> collection and a List<SortableColumn> collection. I populate these collections in the report constructor.
I then bind a checkbox list in the caller to allow the user to specify which columns to show. I also bind a drop-down to allow the user to pick which column to sort on.
I then have methods ShowHideColumn(string key, bool visible) and SetSortColumn(string key, SortDirection direction) available for the caller to chose which columns to show and sort by.
My problem is that setting these properties on the list are simply wiped away the next time the constructor is run. Is there a way to preserve these values. Web caching perhaps? I'd rather not use caching if there is a better way to preserve them, but i will do what i have to to preserve the binding functionality.
Thanks,
Scott