UserAddedRow event not fired when in the empty space in the grid

4 posts, 0 answers
  1. Vincent Willems
    Vincent Willems avatar
    1 posts
    Member since:
    Mar 2010

    Posted 10 Jan 2012 Link to this post

    Hi,

    When I want to add a new row (by the 'add new row line') to my grid, it works fine when I commit the new row by pushing the 'enter' key. But when I fill in some new data in the new row line and I click (by mouse) in the empty space in the grid. The new row appears in the grid but its not commited,& it does not fire the UserAddedRow event.
    How is it possible to make the new data is commited not by pressing the 'enter' key but by clicking in the empty space in the grid?

    Kind regards
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 13 Jan 2012 Link to this post

    Hello Vincent Willems,

    Thank you for contacting us.

    This appears to be an issue and I logged it in our issue tracking system. We will address it in one of our upcoming releases. I updated also your Telerik points for bringing our attention to this issue.

    You can work around it by using the RowsChanged event instead:
    void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)
    {
        if (e.Action == NotifyCollectionChangedAction.Add)
        {
            //...
        }
    }

    If you need further assistance, please do not hesitate to write back.

    Kind regards,
    Jack
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

  3. Ralph
    Ralph avatar
    1 posts
    Member since:
    Jan 2012

    Posted 25 Jan 2012 Link to this post

    I have a similar need.  I cannot find the event which fires when the user clicks on the "add new row" link on RadGrid.

    I need to do somethings before the user sees the insertion form.

    Been looking all over for this event, can't seem to find it.

    Thx.

    -Ralph

    BTW: when are you going to improve your documentation??  :)
  4. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 27 Jan 2012 Link to this post

    Hello Ralph,

    Clicking on the "Add new row" link changes the current row, so you can handle the CurrentRowChanged event:
    void radGridView1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e)
    {
        if (e.CurrentRow is GridViewNewRowInfo)
        {
            //...
        }
    }

    However, I think that in you case the DefaultValuesNeeded event is more suitable. It fires when adding a new row, just before entering edit mode:
    void radGridView1_DefaultValuesNeeded(object sender, GridViewRowEventArgs e)
    {           
        e.Row.Cells["ID"] = GenerateNewID();
        //...
    }

    If this does not help, please describe in detail the behavior that you want to achieve and I will be glad to help further.

    We constantly try to improve our documentation and we appreciate any specific suggestions that you may have.
     
    All the best,
    Jack
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Back to Top