I have a WinGrid that is on a custom control. Several instances of the control are added to a flow layout panel that has a vertical scrollbar.
My problem is that when I click on a cell in my grid (to add a new row) this causes my flow layout panel to scroll in order, I presume, to show my entire custom control. Unfortunatly it doesn;t do a very good job of this and the bottom of the control gets cut-off even if it was entirely visible beforehand.
I'm sure it is the WinGrid causing this because if I activate any other controls on my custom control it stays exactly where it is.
I have attached an image showing what happens. The upper Window in the image show the initial state and a red circle showing where the user is going to click. The lower Window shows what happens after the click when the control gets auto-scrolled downwards cutting off the bottom of the grid.
Is there any way to stop this? Or is there something I'm doing wrong?
Thanks
Hi,
What's a "flow layout panel"? Is this just a panel with an UltraFlowLayoutManager?
If that's the case the my guess is that this is not related to the ULtraFlowLayoutManager, that's it the panel that's doing it. If you have an Inbox Panel with AutoScroll set to true, then it tries to keep the active control in view. So if you tab from one control to another, it tries to scroll that control into view so the user can see it. When you click into a grid cell and it does into edit mode, the grid creates a child TextBox control and places it over the cell for editing. So the panel may be scrolling so that this control is entirely in view.
I can't think of any way around this. The panel doesn't allow you to turn this functionality off as far as I know.
I've observed this problem as well. This is a quick Panel wrapper solution that surpresses the ScrollToControl response of the UltraGrid. It stops the grid from autoscrolling to the top of the ScrollableControl when the grid gets focus.
protected override System.Drawing.Point ScrollToControl(Control activeControl){ if (activeControl is Infragistics.Win.UltraWinGrid.UltraGrid) { // suppress return new System.Drawing.Point(0, CurrentScroll); } else { return base.ScrollToControl(activeControl); } }}
I believe that there have also been fixes regarding this issue. You should ensure that you have the latest hotfix installed; if you still experience the problem with the latest hotfix, you should contact Developer Support regarding the issue, since I think there has also been a change made pretty recently regarding something similar.
-Matt