Grid / User control edit form

4 posts, 0 answers
  1. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 30 Mar 2011 Link to this post

    Hi,

    In my grid I am using grid / user control edit form, and I have a delete option also like in your demo - http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx. However, when I delete the row that I have edit form expanded the edit form for the next item in the grid expands automatically. I want the edit form to be shown only when the user selects to edit the item and not automatically when the user deletes the item above with the expanded edit form. How can I do it?

    Thank you
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2011 Link to this post

    Hello,

    I guess you have added the following code in PreRender event (which will show the first item in edit mode). Remove that code and see whether it works now.

    C#:
    protected void RadGrid1_PreRender(object sender, System.EventArgs e)
            {
                    this.RadGrid1.MasterTableView.Items[1].Edit = true;
                    this.RadGrid1.MasterTableView.Rebind();
             }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tatiana
    Tatiana avatar
    19 posts
    Member since:
    Nov 2008

    Posted 31 Mar 2011 Link to this post

    Thank you for the suggestion. It would be a good solution. However, I do not have these lines of code. Probably I did not describe the situation clear enough. And I apologize for that. The scenario is like that. The user wanted to edit an item and after reviewing the information decided to delete it without canceling the edit mode. After the delete, the next item in the grid automatically appears in edit mode. I want it to stay as it was before deleting - not in the edit mode. And I noticed that it happens with user control.
  5. Tatiana
    Tatiana avatar
    19 posts
    Member since:
    Nov 2008

    Posted 31 Mar 2011 Link to this post

    The solution is turned out to be pretty simple. All what I needed to do is to clear EditIndexes of the grid on delete:

        grdSurveys.EditIndexes.Clear();

Back to Top