Completing an edit without changing rows

5 posts, 0 answers
  1. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 16 Aug 2007 Link to this post

    Hi,

    I have a grid bound to a list of custom objects.  The first column is a GridViewBoolean Column.  When a user clicks on the check box I would like the value immediatly reflected back into the underlying data source rather then having to change rows for it to be commited.

    Is this possible?

    Thanks.
  2. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 16 Aug 2007 Link to this post

    Ok, it looks like I can call SaveValue on the RadCheckBoxEditor during a cell click event.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 17 Aug 2007 Link to this post

    Another issue.  It only works when I click on the check box itself.
    If I click on the surrounding cell, the checkbox changes state, but I am not able to get to the RadCheckBoxEditor because the sending object is actually a GridCheckBoxCellElement.

    Any thought?

    if (alertGrid.SelectedElement is RadCheckBoxEditor)

    {
       RadCheckBoxEditor rbe = (RadCheckBoxEditor)    alertGrid.SelectedElement;

    rbe.SaveValue();

    UpdateSelectedDeviceList();

    }

    else

    {

    GridCheckBoxCellElement gce = (GridCheckBoxCellElement)

     

    }

  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 20 Aug 2007 Link to this post

    Hello johns,

    RadCheckBoxEditor is always the first child in the children's hierarchy of GridCheckBoxCellElement. It can be reached trough the Children property. If you process the CellClick event, the cell is accessible through the sender argument of the event:

    void radGridView1_CellClick(object sender, GridViewCellEventArgs e)
    {
        GridCheckBoxCellElement cell = (GridCheckBoxCellElement)sender;
        RadCheckBoxEditor editor = (RadCheckBoxEditor)cell.Children[0];
    }

    Let us know if this helps.


    All the best,

    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 20 Aug 2007 Link to this post

    Thank You,  That did the trick.
Back to Top
UI for WinForms is Visual Studio 2017 Ready