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.

Restricting key hits in a cell !!

Thread ID:

Created:

Updated:

Platform:

Replies:

30859 Jun 24,2005 02:57 PM Jun 24,2005 05:20 PM Windows Forms 3
loading
Tags: GridControl
Lokesh Luthra
Asked On June 24, 2005 02:57 PM

Hi I have a very simple Question . if I put a focus on a particular cell thru mouse and then click Delete then the value in the cell gets deleted . If I make that particular cell as disabled then in that case it works fine since I am not able to edit so question of deletion does not exists, but I can not make that cell as disabled as I have text in that cell which is not visible completely so i have to click in the cell and using that right arrow key I can see the text .So is there any way with which i can simply make use of the right arrow key and the left arrow key .just to scroll thru the cell. I hope I am able to make you understand the Problem. This is the code which i had used. Private Sub strategyPeriodGrid_CurrentCellControlKeyMessage(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCurrentCellControlKeyMessageEventArgs) Handles strategyPeriodGrid.CurrentCellControlKeyMessage Dim keyCode As Keys If strategyPeriodGrid.CurrentCell.ColIndex = 1 Then keyCode = CType(e.Msg.WParam.ToInt32, Keys) And Keys.KeyCode If keyCode <> Keys.Right OrElse keyCode <> Keys.Left Then e.Handled = True e.Result = True End If End If End Sub

Administrator [Syncfusion]
Replied On June 24, 2005 03:43 PM

If you want to avoid clearing the cell''s contents when you press the Delete key, try setting the style.ReadOnly = true for that cell. Then I think you should be able to click the cell to activate it and use teh arrow keys without having to subscribe to teh CurrrentCellControlKeyMessage event.

Lokesh Luthra
Replied On June 24, 2005 03:54 PM

Yes Clay but When I am making that cell as readonly then in that case that the right arrow and the left arrow key does not work , >If you want to avoid clearing the cell''s contents when you press the Delete key, try setting the style.ReadOnly = true for that cell. Then I think you should be able to click the cell to activate it and use teh arrow keys without having to subscribe to teh CurrrentCellControlKeyMessage event.

Administrator [Syncfusion]
Replied On June 24, 2005 05:20 PM

Readonly normally does not affect the arrow key behavior. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GC_ReadOnlyArrowKeys_5414d88.zip Now when you get to the end of the word, and you press teh arrow again, it does move to teh next cell by default.

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.

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.

;