nowandever29
MIS
All,
In VS 2008 I have a gridview attached to a SQL 2008 datasource. It works perfectly, of course. I have an area on the form to let the user select the columns that are shown. I've tried updating the select statement, but when the user removes columns they don't want, the gridview throws an error because it was expecting the columns in the datasource.
So I've tried dynamically removing all of the columns in the grid view, and adding them back in accorind to what the user selected, but it's asking for a "system.web.ui.webcontrols.datacontrolfield", but I can't figure out how to create a bound datacontrolfield to the data source.
Another way I thought of handling this is to simply hide the columns in the dataview, but I can't figure out how todo that either.
Any help would be greatly appreciated!
In VS 2008 I have a gridview attached to a SQL 2008 datasource. It works perfectly, of course. I have an area on the form to let the user select the columns that are shown. I've tried updating the select statement, but when the user removes columns they don't want, the gridview throws an error because it was expecting the columns in the datasource.
So I've tried dynamically removing all of the columns in the grid view, and adding them back in accorind to what the user selected, but it's asking for a "system.web.ui.webcontrols.datacontrolfield", but I can't figure out how to create a bound datacontrolfield to the data source.
Another way I thought of handling this is to simply hide the columns in the dataview, but I can't figure out how todo that either.
Any help would be greatly appreciated!