Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1035
WebHierarchicalDataGrid Binding
posted

I have a WebHierarchicalDataGrid (2010.2 Net CLR 2.x) control on a web page and I want to bind a dataset to it as the datasource. It's a display only grid with grouping and sorting enabled. On the first page load everything displays properly. A routine is called that queries data into a dataset and then assigns it to the WHDG followed by a databind of course. Everything looks great at this point. I have EnableDataViewState set to true on the grid. When I try to perform any grouping or sorting on the grid it posts back and then displays empty (as if the viewstate for the data was not preserved).

If I rebind by recreating the dataset everypost, the grid works as expected but that seems very inefficient to call the database everytime someone wants to regroup the grid or sort. BTW, my data model is flat. I am only using the Hierarchical grid to take advantage of grouping, filtering and sorting. This ability was touted in the grids overview.

Next thing I try is to store the dataset in viewstate after the first page call and grid binding and then on successive calls reassign the dataset to the grid datasource on page load followed with a rebind. This eliminates the redundant database calls. Although this technically works, I am curious as to why I have to do this. It seems as though enableDataViewState is not working although it is set to true.

I dont want to use a datasource control because I would be forced into an ODBC model as your data source control doesnt work natively with SQL 7. Your control asks for Sql 2000 or higher data source.

So, I need to use a dataset and I need the data viewstate storage mecahnism to work. Is this a bug in the product or am I overlooking something simple?