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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

cancel event returns cursor to top

Thread ID:

Created:

Updated:

Platform:

Replies:

30197 Jun 13,2005 07:02 PM Jun 13,2005 08:52 PM Windows Forms 4
loading
Tags: GridControl
Bernard Herrok
Asked On June 13, 2005 07:02 PM

Hi, I am trying to simulate readonly property for the griddataboundgrid object. In the OnCurrentCellActivating i am checking to see if the form is readonly and cancel the request accordingly. The problem here is, that every time the user scrolls down and then click on any cell, the grid returns to the top. It doesn''t happen if the scroll horizontally though. I don''t want to set every cell to readonly, because the grid''s quite large. Here''s the code i''m using that''s causing the problem (i believe). Protected Overrides Sub OnCurrentCellActivating(ByVal e As Syncfusion.Windows.Forms.Grid.GridCurrentCellActivatingEventArgs) If Not mReadOnly Then MyBase.OnCurrentCellActivating(e) End If e.Cancel = mReadOnly End Sub Thanks in advanced!

Administrator [Syncfusion]
Replied On June 13, 2005 08:23 PM

Instead of setting e.Cancel = true, try setting e.ColIndex = 0 to see if that will do what you want.

Bernard Herrok
Replied On June 13, 2005 08:29 PM

Clay, I think you missunderstood what I meant. All I want the grid to do is ignore the entering of a cell. Just so it acts like it''s readonly/disabled. On the onCellActivating event I cancel (e.cancel = true) the user request. This works ok. But the grid then goes to the top, instead of just staying where the user clicked. >Instead of setting e.Cancel = true, try setting e.ColIndex = 0 to see if that will do what you want. > >

Administrator [Syncfusion]
Replied On June 13, 2005 08:40 PM

If you cancel OnCurrentCellActivating, the focus will not move to the clicked cell. If you do not want to see the cursor in ths clicked cell, but still let the click cell get focus, then try handling CurrentCellStartEditing, and setting e.Cancel there.

Bernard Herrok
Replied On June 13, 2005 08:52 PM

Thanks Clay, that''s worked a treat! >If you cancel OnCurrentCellActivating, the focus will not move to the clicked cell. > >If you do not want to see the cursor in ths clicked cell, but still let the click cell get focus, then try handling CurrentCellStartEditing, and setting e.Cancel there.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;