Hello,
I've hit an unusual snag... when I'm hiding my columns (as I've done many times in the past) currently they are showing up as empty white space to the right of my visible columns. I've moved the "hide" code to many places (initializelayout, form_load, after datasource, etc.) and still they show up. The only time they don't show up is when I bind to an empty collection. As soon as I bind to a collection with items in it, the empty column space returns...
Any ideas?
I'm not sure I understand the issue. Of course a hidden column shows as empty space. What are you expecting it to show?
Can you post a screen shot? Or a small sample project demonstrating the issue?
I'll get a screenshot here in a bit... but a better description would be that the grid has about 50 columns in it with 40 of them hidden... you see the 10 columns that aren't hidden, as you would expect, but then the horizontal scrollbar allows you to scroll way to the right of the 10 visibile columns to see a big white area where those other 40 columns would be if they were visible. If they are hidden, they shouldn't be allocated space on the grid so the scrollbar won't know about them, etc. At least, that's how I undrestood it, and this is the first time I've noticed this, so I'm assuming there is something different about this implementation.
I'll post some code shortly.
I doubt that the scrolling is being affected by hidden columns. Most likely, there is a second band in the grid and the scrolling is accounting for the columns in the child band(s).
If that's the case, try setting the grid.DislpayLayout.ViewStyle to SingleBand - assuming you don't want the child band displayed.