|
-
May 10th, 2013, 03:07 PM
#1
Thread Starter
Junior Member
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? Thanks much for any help
-
May 10th, 2013, 03:16 PM
#2
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?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 10th, 2013, 07:36 PM
#3
Thread Starter
Junior Member
Re: 2 Frozen columns and 1 scrolling column in middle??
 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?
-
May 10th, 2013, 09:28 PM
#4
Hyperactive Member
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.
-
May 10th, 2013, 10:39 PM
#5
Thread Starter
Junior Member
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
Last edited by vincegrear; May 10th, 2013 at 11:46 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|