We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

covered ranges and scrolling

I have rows with covered ranges of various sizes that span columns. If the beginning of a covered range is not visible and I click on it, the grid automatically scrolls left to make it visible. Is there any way to prevent the grid from scrolling? It's particularly an issue when I am using the keyboard to navigate the grid rows. The grid will scroll left and right as I move the current cell frame up and down on the various sized ranges.

6 Replies

HA haneefm Syncfusion Team May 3, 2007 03:39 PM UTC

Hi J shonw,

The AllowScrollCurrentCellInView property specifies the mask for which reason the scrolling should happen, this defines the ScrollCurrentCellInView behavior of the grid. You can try setting this to GridScrollCurrentCellReason.None and let me know if this helps.

this.gridControl1.Model.Options.AllowScrollCurrentCellInView = GridScrollCurrentCellReason.None;

Best regards,
Haneef


JG j g May 3, 2007 04:42 PM UTC

I tried setting AllowScrollCurrentCellInView to none and it works great when I click on a covered range. But, now the grid will not scroll down or up when I use the up and down keys to move current cell frame. In this case, it appears that I will have to handle the scrolling myself, unless there is a better way?


HA haneefm Syncfusion Team May 3, 2007 06:23 PM UTC

Hi J shonw,

You can try this code:

this.gridControl1.Model.Options.AllowScrollCurrentCellInView = GridScrollCurrentCellReason.MoveTo ;

Best regards,
Haneef


JG j g May 4, 2007 07:53 AM UTC

Haneef, it would work great if I could prevent the grid from scrolling to the left when the current cell frame moves onto ranges (by clicking on AND using up and down key navigation) that are partially visible.


HA haneefm Syncfusion Team May 5, 2007 12:56 AM UTC

Hi J,

You need to handle the TopRowIndexChanging event for cancelling the up and down movement of the cellview in a grid and ahndle LeftColChanging event for cancelling the left to right/right movement of the cellview in a grid. Please try the attached sample and let me know if this helps.

Sample : CoverdeRange.zip

Best regards,
Haneef


JG j g May 5, 2007 04:15 AM UTC

Haneef, this is perfect! Thanks a lot.

Loader.
Live Chat Icon For mobile
Up arrow icon