Hi,
I have a hierarchical grid that contains only 2 small visible columns. When my form loads, I can see both columns of data perfectly fine, but for some reason I have a horizontal scrollbar at the bottom of my grid that scrolls very far to the right of my columns and just shows a bunch of white space.
I can't figure out why this scrollbar is appearing. I want it to only appear if I can't see the contents of my last column in the grid. I have tried playing around with many different scrollbar properties with no luck so far.
Thanks,
~Corey
Hi Corey,
If the horizontal scrollbar is much larger than it seems to need, then there must be a reason why it thinks the scroll area is so large. The obvious reason for this is that your grid has a child band that is much wider than the parent band.
What kind of data source are you using for the grid? My guess is that you are probably using a DataSet or a table in a DataSet that has a child relationship defined.
If that's the case, then you probably just need to set the ViewStyleBand on the grid to SingleBand. If that doesn't help, try setting MaxBandDepth to 1.
Mike,
My grid is a fairly simple list of team member names shown as a hierarchy. When I expand all rows, I do not see any child band that is larger than anything else.
When I set the ViewStyle to SingleBand, it does fix the scrolling, but obviously I want my bands to show.
I am binding a list of TeamMember objects to the grid. Each TeamMember object has a Team property that defines a list of child team members that report to that person. And so on.
This is how I create my list.
TypedBindingList<TeamMember> boundList = new TypedBindingList<TeamMember>(teamMembers, new List<string>() { "FormattedName", "Team" });
Any other ideas?