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.

delete key versus ctrl-delete

Thread ID:

Created:

Updated:

Platform:

Replies:

46839 Jul 21,2006 11:23 AM Jul 24,2006 10:48 AM Windows Forms 2
loading
Tags: GridControl
Philip Bishop
Asked On July 21, 2006 11:23 AM

During some testing I accidently hit ctrl delete on a cell. Then when I tried to close my form it blew up because i was trying to do a conversion to a single and it then thought it was text. I have a attached a sample I wanted you to try. Run the sample and then if you hit the delete key on cell 1,1 and click the first button it will change the text next to that button to 0 like it should. If you click that cell again and hit ctrl delete and then click the second button you will see in the text box next to it that it doesnt display anything. This doesnt happen in our app that is live now using 3110 of your grid. Now the reason I think that is, is because all of those forms in our live version have clearing cells events. In this new version of the grid of yours and the way you changed null values and empty strings and all that around we dont use clearing cells on some forms per stefans advice and some things he fixed for us. It''s almost like you are deleting the style or something. Is there a simple way to solve this and always put the zero in there and if not is there a way to just disable ctrl delete?

CTRL Delete.zip

Administrator [Syncfusion]
Replied On July 22, 2006 05:33 AM

If you want to see a zero when you press ctl+del and avoid the problem you described, I think you can do it with the event handler below. If you just want to ignore the ctl+del, then you can just set the e.handled in the event code and not use the other code.

I will forward this issue onto the dev team to see if this is something they want to try to address in our code. I suspect the proper behavior would be to just ignore the ctl+del so it does not cause any problem, but we will have to research the issue to see what is going on before we decide what to do.


Private Sub gc1_CurrentCellKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles gc1.CurrentCellKeyDown
If e.Control AndAlso e.KeyCode = Keys.Delete Then
Me.gc1.CurrentCell.Renderer.Control.Text = "0"
Me.gc1.CurrentCell.Refresh()
e.Handled = True
End If
End Sub

Philip Bishop
Replied On July 24, 2006 10:48 AM

That works great. I am just disabling it and not putting in the zero. One other thing I noticed that is related to this has to do with horizontal alignment. When we first started setting up grids we always set that up in the code. In the sample I sent I did it in the range collection for the grid in the ide. If you right click on the horizontalalignment in the range collection and reset it and then put it in the code as right aligned, hitting ctrl delete has a different outcome. Then it left aligns the zero in that cell. I dont know if thats related or some other quirk. Just thought I would point it out. Thanks again.

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.

;