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

problem with my clearingcells event

Thread ID:

Created:

Updated:

Platform:

Replies:

18902 Sep 13,2004 12:39 PM UTC Sep 14,2004 10:31 AM UTC WinForms 5
loading
Tags: GridControl
Philip Bishop
Asked On September 13, 2004 12:39 PM UTC

I have this problem with a grid that I cant seem to figure out. If you run this sample that i have attached and type in a numeric value in cell 1,1. Then hit the OK button and u will get an error message that is specific to our app. After u get the error click ur mouse in cell 1,1 and try to hit the delete key which is suppose to put a zero in the field from the clearning cells event. It doesnt work. If u come in to this app fresh and hit delete on the cell it puts the zero there fine. If after the error message u move off the cell by either clicking another cell or arrowing to another cell and then back to 1,1 and then hit the delete key it works fine. Its only right after the error message that this happens. It doesn this on any cell in that column. Am i missing something? I''ve tried everything I can come up. Thanks in advance. clearingcellPROB_8068.zip

Administrator [Syncfusion]
Replied On September 13, 2004 02:42 PM UTC

I can get you sample to work by adding this code at the bottom of your button click handler. > Me.grdAGCY_AR.Focus() Me.grdAGCY_AR.CurrentCell.MoveTo(-1, -1) Clicking the button gives the focus to the button, and when the messagebox closes, it is teh button that retains focus and not the grid. So, calling grid.Focus gives the focus back to teh grid. The other call is to force the cell to refresh itself.

Philip Bishop
Replied On September 13, 2004 03:09 PM UTC

Ok so i dont get what the problem is with it. Why after the error can i click on the cell under the errant cell and hit delete. Whats the diff between clicking that cell or the one that had the error. Seems to me as if i''d be doing the same thing???

Administrator [Syncfusion]
Replied On September 13, 2004 04:14 PM UTC

Did adding the two lines work around the problem for you? What I think is happening is the the Currency control is not being reinitialize on the click since it is already located at the cell being clicked. This is causing the code in your clearing cells which changes the data using indexer''s on the grid not to affect the value in the actively editing (from the click) cell. Using the 2 suggested lines seems to avoid this problem. I will discuss this with Stefan to see if this is something that we can address in our library but I am not sure how much work this might be.

Philip Bishop
Replied On September 14, 2004 10:23 AM UTC

Yes that did solve the problem. I just didnt understand what it was doing and why it was happening. What does setting that to -1 -1 do? Why doesnt that move the cursor from the current cell to -1 -1???

Administrator [Syncfusion]
Replied On September 14, 2004 10:31 AM UTC

Using the -1, -1 makes the grid not have a current cell. Thus, when the current cell is then later reset with the click on 1,1, the CurrencyEdit control does not think it is already active, and reinitializes itself.

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

;