how to do?

rupalisharma

New member
Joined
Jun 22, 2005
Messages
1
Programming Experience
Beginner
Dynamically populating datagrid based on user selections

hello!!!

i m making an application with vb.net as front end n MS access as back end.
following is what i want:
in one form, it has checkboxes with fieldnames of the table i hav connected to.
the user should check the checkboxes corresponding to field which he wants to view.
i need to view table in a datagrid with only those fields of table for which checkboxes are checked.
how to do dat
neone knowinn dat may plz tell me or send code asap.
thank you
 
Last edited by a moderator:
and why not u requiry again with specified fields (the simplest solution as i think becuase you are in which context you should try to simple solutions)
what i mean
when a user selects the columns name, collect them and build the dynamic SQL and fetch the data again i.e. call adapter.fill(ds) thats all u have refreshed set of values and assign the gird to it.
 
I would recommend against repeated database accesses. If you don't want to use column styles you could simply call DataTable.Copy() to create a copy of your table and then remove the columns that you don't want to display.
 
Back
Top