PrepareDataBinding & Columns

1 reply. Last post: June 13, 2010 9:51 PM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Brad LoveallMember

Our users are able to save their column preferences so that, if they select some columns on a particular page for removal, these preferences are saved so that when they return, they do not initially see those columns.

Say, for instance, that I have a grid with three columns (FirstName, LastName, Nickname). A user comes along and selects "Nickname" for removal. This is saved. The user comes back and does a search, the results of which are displayed in a WebGrid. Initially, they do not see Nickname. If they do another search that results in data, they likewise do not see Nickname. So far so good. But the problem that I am experiencing is that if the result set is empty (e.DataSource is set to a DataTable that is "Nothing") and then the user does another search which has results, the "Nickname' column is showing up. So the problem arises in a grid where one search results in a data, a second search results in no data, and a third search results in data.

The code that manages the columns is contained in "PrepareDataBinding" and the routine that I use to retrieve columns is called on the first search (on a post back) but not on subsequent searches. This typically works fine but not in the case above. Do you have an idea as to what might be causing this issue and what I can do about it? Do I have to call my routine to reload the columns after any empty result set?

Thanks,

Brad

All times are GMT -5. The time now is 11:27 PM.
Previous Next