Checkbox Event Quection

2 posts, 0 answers
  1. Nick
    Nick avatar
    1 posts
    Member since:
    Nov 2011

    Posted 15 Dec 2011 Link to this post

    Hello Guys,

            private void radGridViewTakeSomeData_CellValueChanged(object sender, GridViewCellEventArgs e)
            {
                bool isChecked = (bool)e.Row.Cells[4].Value;
                if (isChecked == true)
                {
                                //Do something....
                }
            }

    When I check GridViewCheckBoxColumn , the event acts the moment I click somewhere else in the grid. Should I change the event I'm using or is any "End Edit Mode" property in order to act immediately after I tick the Checkbox??

    Thanks in advance!!
  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 20 Dec 2011 Link to this post

    Hello Nick,

    Thank you for writing.

    To force the change of the cell value immediately after you click the check mark, you can add the following event handler for the RadGridView MouseDown event to your code:

    private void radGridView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
      RadCheckmark checkmark = this.radGridView1.ElementTree.GetElementAtPoint(e.Location) as RadCheckmark;
      if (checkmark != null)
      {
        this.radGridView1.EndEdit();
      }   
    }

    I hope this will help you.

    Please note that we are still expecting an answer from you on the questions asked in your thread "RibbonBar & Forms". This will allow us to continue supporting your enquiries.

    Greetings,
    Ivan Petrov
    the Telerik team

    Q3’11
    of RadControls for WinForms is available for download (see what's new). Get it today.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top