Hi,
I am trying to prevent the grid from scrolling horizontally to the right when the user clicks in the filter cell in a grid; the scrolling prevents the previous columns (which in this case are both small and important) from being seen. I cannot find any settings for this at the grid, column, or cell level, but I may have missed. Any pointers?
Thanks,
J
I'm not sure I'm understanding 100% of what you want to do... do you want to fix the small important columns so that they always are visible and never scroll horizontally? That is using FixedHeaders for the Column (MyColumn.Header.Fixed = true). Are you trying to accomplish something else? Do you have a snippet or screenshot that shows what you are after?
When the user clicks in the filter cell in the right-most column, the grid scrolls over to make that cell the left-most visible cell; the previous columns' cells are now out of view. I simply want the grid not to scroll to the cell when the user clicks in it.
I will try fixed headers and see if that solves the problem.
Well, the grid is a master list in a configuration table, and somewhere in the list there is a really long description. It's not that I want the user to not see all of the ActiveCell, the cell the user clicks into is the FilterCell for the column, so initially it is blank. I guess part of it is still 'out of view' because the column is so long.
So here's what I did that worked: I do PerformAutoResize on the description column on VisibleRowsOnly, then I set the layout's AutoFitStyle to ExtendLastColumn.
Thanks for the tip,
The grid will still auto-scroll that cell into view. The Fixed Headers makes those small columns you still wanted visible... still visible when this happens, the behavior still persists and there is no property to turn it off. To prevent this behavior you can AutoFit the columns with DisplayLayout.AutoFitStyle = ResizeAllColumns. Which eliminates the scrollbar. Or size the grid enough horizontally that all the columns fit. Fixed Headers allowed those important columns you wanted always visible, still visible.
EDIT: Yeah... basically what Mike says above.
The idea of the fixed column is that it will keep the fixed columns visible and prevent them from scrolling out of view.
But you can't stop the grid from scrolling the active cell into view. When you click on a cell and make it active, the grid will always scroll that cell into view if it was partially out of view. Why would you want to? That doesn't really make sense to have an ActiveCell that the user cannot see part of.
If it was already completely in view and you are saying that it is scrolling anyway, then something is wrong.
I tried it, but fixed headers are not preventing the grid from auto-scrolling to the active cell when I click in the filter cell. Is there a way to prevent this behavior?