I have a DataGridView that's bound to a DataSet. It has columns DateCreated, Weight, DateUsed. Those three columns do not take up much horizontal space on DataGridView that is nearly full screen. Is it possible to have those columns wrap back to the top if the view is wide enough to support a second group of those colums. So across the header it would read DateCreated, Weight, DateUsed, DateCreated, Weight, DateUsed. Then when a row is clicked, only 3 cells would be highlighted, not all six. Is there something that can provide this functionality?
I don't know of anything like that out of the box.
You could create that effect yourself. You would need to decouple the actual data from the presentation of the data. Instead of a single DataRow per grid row, you'll need to merge them together to show multiple rows on a single row.
So your helper method might do the following:
Some considerations: can users sort the data? If so, you'll have to write that yourself.
Do you need to be able to add new rows using this view? That sounds very difficult with this kind of view.
I realize you posted this question in April, and so you've probably already found a solution or else moved on to something else. However, I recently wrote a control that does basically just what you describe, and you can download it freely from BitBucket here:
https://bitbucket.org/dtao/taocontrols/downloads
If you're interested, give the SplitDataGridView
control a shot and let me know what you think.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With