Need to prompt message when RadGrid item is edited or inserted

2 posts, 0 answers
  1. Manoj
    Manoj avatar
    26 posts
    Member since:
    Feb 2012

    Posted 09 Apr 2012 Link to this post

    I have clicked edit button of an item(Radgrid).

    Now the particular row is in edit mode.

    When i click the submit button.It should prompt me to save the edited row.

    How can i achieve it.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Apr 2012 Link to this post

    Hello Manoj,

    Try the following code.
    C#:
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
     if (e.Item is GridEditableItem && e.Item.IsInEditMode &&!e.Item.OwnerTableView.IsItemInserted)
     {
      GridEditableItem itm = (GridEditableItem)e.Item;
      LinkButton updateButton = (LinkButton)itm.FindControl("UpdateButton");
      updateButton.Click += new EventHandler(updateButton_Click);
     }
    }
    void updateButton_Click(object sender, EventArgs e)
    {
     RadWindowManager1.RadPrompt("please save", "promptCallBackFn", 330, 160, null, "RadPrompt", "0");
    }
    JS:
    function promptCallBackFn(arg)
    {
     alert("Successfully saved");
    }

    Thanks,
    Princy.
Back to Top