+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Cancelling the delete of user

Cancelling the delete of user

4 posts, 0 answered
  1. ermi
    ermi avatar
    5 posts
    Registered:
    15 Jun 2012
    13 Sep 2010
    Link to this post
    Hi,

    Below, I am doing a simple test of cancelling the deletion of user.

    void manageUsers_DeletingUser(object sender, ActionCancelEventArgs e)
    {
        e.Cancel = true;
    }

    In the admin UI, when a user's checkbox is ticked and delete icon (bin image at the far right of the row) is clicked, the returned message is always "User "<user>" successfully deleted.".

    And when the delete hyperlink at the top of the grid is clicked, the page refreshes without any error message, and clicking on any of the checkboxes is giving a javascript error saying "Error: 'CheckBoxIDs' is undefined".

    Is it a bug or I am cancelling the deletion wrongly?

    TIA.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    13 Sep 2010
    Link to this post
    Hi ermi,

    You are canceling the event of deletion correctly. However the success message is something separate, so you would have to prevent it from showing too. Sample code bellow:
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        manageUsers.ModeChanged += new EventHandler(manageUsers_ModeChanged);
        manageUsers.CreatedRole += new RoleCreatedEventHandler(manageUsers_CreatedRole);
        manageUsers.DeletingUser += new ModifingActionCancelEventHandler(manageUsers_DeletingUser);
    }
     
    void manageUsers_DeletingUser(object source, ModifingActionCancelEventArgs e)
    {
        e.Cancel = true;
        ((MessageControl)manageUsers.Controls[0].FindControl("message")).Visible = false;
    }


    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. ermi
    ermi avatar
    5 posts
    Registered:
    15 Jun 2012
    14 Sep 2010
    Link to this post
    Thanks for the tip on the message control!

    But what about the issue I mentioned:
    And when the delete hyperlink at the top of the grid is clicked, the page refreshes without any error message, and clicking on any of the checkboxes is giving a javascript error saying "Error: 'CheckBoxIDs' is undefined".
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Sep 2010
    Link to this post
    Hello ermi,

    We are not able to reproduce an issue with the GridView and CheckBoxIDs. There was a similar bug in older versions prior 3.7 SP3. I attached a sample video. Let me know if we are missing something, so we can narrow down the problem.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered