This is a migrated thread and some comments may be shown as answers.

Grid with modal Edit-Popup

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeroen Eikmans
Top achievements
Rank 1
Jeroen Eikmans asked on 08 Nov 2010, 04:37 PM
Hi,

I have radgrid setup with a popup modal editform.
The editform has two button Save and Cancel. These work with CommandNames "PerformInsert" and "Cancel"

In the InsertCommand event i process the actual insert into the database.
During this InsertCommand the Popup editform remains visible and the user can click on Save again, so the InsertCommand event is triggered again.

Is'n't it possible to have the LoadingPanel cover the popup-form? It does cover the grid during InsertCommand.
Or is there another way to prevent the user from clicking Save more than once?

Kind regards.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 09 Nov 2010, 05:40 PM
Hi Roel,

You can use a RadAjaxLoadingPanel over the whole page like this:

http://www.telerik.com/community/code-library/aspnet-ajax/ajax/how-to-make-a-radajaxloadingpanel-span-over-the-whole-page.aspx

Or you can hide the edit form when a button is pressed like this:

C#

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
    {
        LinkButton ub = e.Item.FindControl("UpdateButton") as LinkButton;
        if (ub != null)
            ub.OnClientClick = String.Format("hidePopup('{0}')", (sender as RadGrid).ClientID);
        LinkButton ib = e.Item.FindControl("InitInsertButton") as LinkButton;
        if (ib != null)
            ib.OnClientClick = String.Format("hidePopup('{0}')", (sender as RadGrid).ClientID);
    }
}

Javascript

function hidePopup(gridID)
{
    $telerik.$("#" + gridID + " .rgEditForm").css("display", "none");
}


Best wishes,
Dimo
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
Tags
Grid
Asked by
Jeroen Eikmans
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or