Datagridview Header and checkbox

timmeh_041

New member
Joined
Jul 19, 2007
Messages
2
Programming Experience
Beginner
Hey guys,

I have a bit of a query and was hoping you guys could help me out.

Bit of background.

I have a excel document which I have read into a datatable. I have then set that datatable as a source for a datagridview. So far it works great, everything reads in and populates well. The top row of the excel document are the heading titles for each column in the datatable. This is shown in the gridview.

I am now wishing to perform a bit of editing. I am wishing to delete a whole column at a time. At the moment I am thinking of a few ways, and the one I think which would work best would be to include a checkbox under the name of each column. Based on whether or not that checkbox is true when some button is pushed, the column will either be deleted or left as it. Are you guys aware of any way which this can be done?

Alternatively, I was thinking of clicking the column title, which would present a yes or no message box for confirmation, which would the delete the column if required. Ofcourse, this doesn't seem to professional when there are many columns that need to be removed. What are your thoughts on this?

Are there any other ways in which I can achieve this?

Thanks
 
You could have a separate CheckedListBox that contained all the column names and the user can then select and delete the appropriate columns. I like the idea of separating that action from the actual display of the data by putting it in a dialogue. You could potentially just hide the columns temporarily if you want to be able to roll-back the change.
 
Back
Top