2 Frozen columns and 1 scrolling column in middle??
I have three columns in an unbound datagridview. All three columns are populated via a button click.
The first and third column must be frozen so that they do not scroll horizontally.
The middle column must scroll horizontally as its cell data is often very long.
I set the first and third to frozen, and set the datagridview to possess both horizontal and vertical scrollbars, and also set the middle column to autosize. However, during runtime the datagridview does not possess any horizontal scrollbar, and the third column is out of view, pushed out of view by the second.
Is what I'm trying to do even possible? :confused: Thanks much for any help
Re: 2 Frozen columns and 1 scrolling column in middle??
Er ... no. But if it's not bound data why not just use 3 list boxes?
Re: 2 Frozen columns and 1 scrolling column in middle??
Quote:
Originally Posted by
dunfiddlin
Er ... no. But if it's not bound data why not just use 3 list boxes?
That's a good ideat dunfiddlin, and I'll definitely consider doing that. I'd prefer however to not have to add any more controls to my form. I should be able to do it just with the datagridview. After all, it has the option to have a column or two Frozen. I just can't get it to work, which is typical. Anybody have any experience with Frozen columns with horizontal scrolling in a datagridview?
Re: 2 Frozen columns and 1 scrolling column in middle??
When you set the frozen state of any column in a datagridview it automatically makes all the columns that precede it frozen as well. The reason your scrollbar disappeared is because your middle column was set to frozen when that happened.
If you want to stick with the DataGridView then you will need to move both of the frozen columns to the left.
Or if your data is for display only then another idea could be to write out the data to a HTML Table and display it in a WebBrowser control.
Re: 2 Frozen columns and 1 scrolling column in middle??
OK I think I've got it figured out now. Thanks much for your suggestions