Keep Popup open after Insert/Edit

4 posts, 0 answers
  1. Edward
    Edward avatar
    20 posts
    Member since:
    Mar 2009

    Posted 23 Apr 2009 Link to this post

    I have a RadGrid that uses a Pop for an editform.  The Popup host a usercontrol with a OK, Close and Cancel button.  When a user selects Edit (or Insert).  They want the OK button button save the form (this works), but the form needs to stay open until the click the Close button on the form.  The automatically generated 'X' close button works so I don't want to break that.  I just need my close button (asp:LinkButton) to do the same thing.

    Thanks,

    Ed
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Apr 2009 Link to this post

    Hello Edward,

    You can access the CloseButton and then add an event handler for the button where in you can close the edit form as shown below:
    ascx:
    <asp:Button ID="Button3" runat="server" CommandName="Save" Text="Save" /> 
    <asp:Button ID="Button1" runat="server" CommandName="Close" Text="Close" /> 
    <asp:Button ID="Button2" runat="server" CommandName="Cancel" Text="Cancel" /> 

    aspx.cs:
     
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
          if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
           {  
            GridEditFormItem editedItem = e.Item as GridEditFormItem;  
            UserControl userControl = (UserControl)editedItem.FindControl(GridEditFormItem.EditFormUserControlID); //access the user control  
            Button closebutton = (Button)userControl.FindControl("Button1");  
            closebutton.Click += new EventHandler(closebutton_Click);           
           }  
        }  
     void closebutton_Click(object sender, EventArgs e)  
        {  
            RadGrid1.MasterTableView.ClearEditItems(); //close the Edit Form 
        }  

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Edward
    Edward avatar
    20 posts
    Member since:
    Mar 2009

    Posted 24 Apr 2009 Link to this post

    almost there.

    How do I keep the form open after the user hits Insert or Update?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Apr 2009 Link to this post

    Hi Edward,

    I am not sure about your scenario. If you want to keep your EditForm from closing, then you can try setting the following code immediately after the insert code or update code.


    CS:
     
    RadGrid1.MasterTableView.IsItemInserted = true
    e.Item.Edit = true

    Thanks,
    Shinu.
Back to Top