Gridcontrol - Mouse scroll in embedded grid in cell
Hi,
I have one main Gridcontrol and some cells have embebed grid. When I scroll over main grid it works fine but I would like to scroll GridInCell when over it.
Is this possible?
Thanks
Hi Dinis Ferreira,
Thank you for your query and for sharing the details regarding the scrolling behavior in your GridControl setup.
Based on the information provided, we understand that the main GridControl scrolls as expected. However, you would like the embedded grid (GridInCell) to scroll when the mouse is hovered over it. We reviewed your scenario and attempted to replicate the issue, but we were unable to reproduce the behavior you described.
In GridControl, the embedded grid does not scroll initially. Scrolling is enabled only for the main grid. Once the embedded grid is clicked, scrolling becomes active for it, and you can then scroll the embedded grid by simply hovering the mouse over it.
To assist you further, we have attached a sample and a video demonstration for your reference. Kindly review them and let us know your observations.
To help us better understand and resolve the issue, we kindly request the following additional details:
- Customizations: Have you applied any custom scrolling behavior or modifications? If so, please share the details.
- Modified Sample: Please update the attached sample to reproduce the issue on your end and share the modified version with us.
Providing these details will help us better understand the issue and offer a more accurate and effective solution.
Regards,
Elavazhagan E
Attachment: GridControl_2839ef51.zip
Hi Elavazhagan
Your example is correct. Also when scroll with click on cell with embedded main grid grid scroll some times.
Im interested in scroll the embedded grid without click on cell. If mouse is over main grid this makes main grid scroll, if mouse is over cell with embedded grid then scroll is applied to embedded grid.
Is this possible?
Thanks
We apologize for the inconvenience. Unfortunately, the fix for this issue was not included today as promised.
If you have any questions or concerns, please feel free to reach out.
Dinis Ferreira,
We have analyzed the reported issue and implemented a sample-level solution. This approach enables embedded grids to scroll when hovered by detecting the mouse position and redirecting the scroll event to the appropriate child grid. Specifically, we’ve used the CellMouseHover event to activate the cell containing the embedded grid, and the VScrollPixelPosChanging event to intercept the scroll and apply it to the embedded grid’s scrollbar. This ensures smooth and intuitive scrolling behavior for nested grids.
We have attached a simple sample and code snippet for your reference. Please review it and feel free to contact us if you have any further questions.
Code Snippet to enable the mouse scrolling for EmbeddedGrid:
public Form1() { InitializeComponent(); gridControl1.VScrollPixel = true; EmbeddedGrid.VScrollPixel = true; } private int ParentGridScrollBarValue; private void EmbeddedGrid_MouseHover(object sender, EventArgs e) { ParentGridScrollBarValue = gridControl1.VScrollBar.Value; } private void GridControl1_VScrollPixelPosChanging(object sender, GridScrollPositionChangingEventArgs e) { GridControl grid = sender as GridControl; Point clientPt = grid.PointToClient(Control.MousePosition); if (grid.PointToRowCol(clientPt, out int row, out int col, -1)) { var covered = grid.CoveredRanges?.FindRange(row, col); if (covered != null && grid.CoveredRanges.Count > 0) { row = covered.Top; col = covered.Left; } GridControl target = grid[row, col].Control as GridControl; if (target != null && target.IsHandleCreated && target.Visible && target.VScroll) { gridControl1.VScrollBar.Value = ParentGridScrollBarValue; e.Cancel = true; } } } private void GridControl1_CellMouseHover(object sender, GridCellMouseEventArgs e) { GridControl grid = sender as GridControl; if (grid[e.RowIndex, e.ColIndex].Control is CellEmbeddedGrid) grid.CurrentCell.MoveTo(e.RowIndex, e.ColIndex); } |
Attachment: MouseHover_cd389edc.zip
Hi
This works good.
Thank you
Dinis Ferreira,
Glad
that your issue is resolved! Please get back to us if you need any further
assistance, we will be happy to help you.
- 8 Replies
- 3 Participants
-
DF Dinis Ferreira
- Sep 16, 2025 11:16 AM UTC
- Oct 17, 2025 08:45 AM UTC