This is a migrated thread and some comments may be shown as answers.

Lost ChecBoxColumn Data on leave focus

5 Answers 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Omesis
Top achievements
Rank 1
Omesis asked on 31 May 2008, 04:06 AM
Hi i have a problem, im using a RadGridView for windows, i have a CheckBoxColumn in editable mode, but when the RadGridView lost the focus, latest changes in the checkbox are lost.

5 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 02 Jun 2008, 01:17 PM
Hi Alejandro,

We are aware of this issue and have planned to address it for the upcoming Q2 release. For now, you could try handling the LostFocus event of RadGridView as shown below:

void radGridView1_LostFocus(object sender, EventArgs e) 
        { 
            if (this.radGridView1.ActiveEditor is RadCheckBoxEditor) 
            { 
                this.radGridView1.EndEdit(); 
            } 
        } 

I hope this helps. If you have any further questions, please contact me.

All the best,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Joel
Top achievements
Rank 2
answered on 02 Jun 2008, 03:15 PM
Thanks, but i have tried with this option and the latest changes in the checkbox are lost too.
0
Jordan
Telerik team
answered on 03 Jun 2008, 07:48 AM
Hi Signus,

I tested the same code and it seemed to work. What version are you using? I tested the code with the Q1 2008 SP1 release of RadControls for WinForms.

Could you share more details about the scenario? Why is the grid view losing focus in your scenario: is another form/window or another control in the same form focused?

I'm looking forward to your response.

Greetings,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael
Top achievements
Rank 1
answered on 23 Jun 2008, 08:09 PM
I am having the same problem.  When I check the checkbox the box becomes check/unchecked as appropriate.  But unless I press Enter or check somewhere else in the grid the change is not saved.  If I check away from the grid control the value in the checkbox reverts to the value before the change.  I have tried using your suggested code in the "Leave" event (my radGridView doesn't expose a "LostFocus" event, do I have the correct version?  I have 1Q2008SP1 installed, the runtime version is v2.0.50727, the Version is 6.1.0.0) The endedit method is executed but the cahange does not take.

Is there a way to capture the toggle of the GridViewCheckBoxColumn to post the change directly into the database in a "brute force" manner?

There seems to be nothing to indicate to the user that some action beyond just checking the box is required.  If he has entered the grid just to toggle a checkbox the behavior is quite anomalous.
0
Jordan
Telerik team
answered on 25 Jun 2008, 11:22 AM
Hello Michael,

I tried the same code but with the Leave event I can confirm that it did not work. However when a workaround is used in the LostFocus handler it seems to work. RadGridView must expose LostFocus event as it is inherited from Control.
Please, try handling the LostFocus event of RadGridView and if that does not solve the problem send us a simple project that we can use to investigate the issue locally.

Best wishes,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Omesis
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Joel
Top achievements
Rank 2
Michael
Top achievements
Rank 1
Share this question
or