I have a data grid that is created based on a query that is created when a user selects which fields he/she wants included. This works fine except when the user goes back to make a different field selection choice, the column names that they formerly selected still appear on the datagrid. No data appears in these columns, but the name of the column still appears.
For example, the user can select name, address1, city, state, zip. The first time through they select just name and address1. The data grid displays just those two column names and the corresponding data in them. Then the user decides to select different choices, so they return to the selection screen. This time they select name and city. The data grid then displays the column names for name, address1 and city and just the data for name and city. I clear my dataset before filling it again.
Can someone help me to determine what I'm missing?
Thanks.
For example, the user can select name, address1, city, state, zip. The first time through they select just name and address1. The data grid displays just those two column names and the corresponding data in them. Then the user decides to select different choices, so they return to the selection screen. This time they select name and city. The data grid then displays the column names for name, address1 and city and just the data for name and city. I clear my dataset before filling it again.
Can someone help me to determine what I'm missing?
Thanks.