We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reducing Number of Columns When Changing Query.

I have a GridDataBoundGrid that is bound to a .mdb using a DataAdapter and DataSet. When I first start the program the grid is filled with data properly. I then change the select command and refill the DataSet. The change to the query is to remove one column that is returned. For example: before SELECT a, b, c, d FROM x after SELECT a, b, c FROM x The proper rows are displayed but I still get a column labeled d. The column d has empty data. How to I get the grid to stop displaying column d, short of manually removing the column. There will be instances where the query is typed in by the user and can be sonewhat freeform. Thanks

2 Replies

AD Administrator Syncfusion Team September 24, 2004 03:25 PM UTC

I think calling Binder.ResetHierarchyLevels() should do it, but check out also that thread: http://www.syncfusion.com/support/forums/message.aspx?MessageID=10185 Stefan

SD Steven Domingue September 24, 2004 05:43 PM UTC

Nope. That didn''t work. After looking to it better I found that I had to: a) make a NEW OleDbDataAdapter with the new command string, b) clear the dataset, c) fill the dataset from the new adapter with a new table name, d) set the datamember of the grid to the new table. The grid would then refresh properly

Live Chat Icon For mobile
Up arrow icon