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

[Solved] Open RadWindow From Edit Column

2 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 26 Mar 2008, 09:24 PM
Is there a way when you the user presses the edit button in the grid to open a radwindow instead of the edit template?  If an item mets a certain condition I need to handle the edit differently.

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {

            if ((e.Item is GridEditFormItem && e.Item.IsInEditMode) && (m_status == -3)) //its draft open rad window
            {
                  //Some how trigger radwindow to open here
                 /*  what goes here to trigger an ajaxpostback javascript trigger
                 *   for window open?
                */
            }
            else if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
            {
                   //Populate the template form as usual
}
}

2 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 27 Mar 2008, 06:41 AM
Hi John,

You can find it in this online example. In addition, I am glad to announce that pop-up edit form will be supported by RadGrid out of the box in our next release (Q1 2008 ) expected in mid April. You can check it in our "Futures" release, more details are available here.

Greetings,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John
Top achievements
Rank 1
answered on 27 Mar 2008, 04:11 PM
Thanks for the link, that helped me get it working.  My solution ended up being a little different so I'll post my solution:

In aspx I have a GridEditCommandColumn with a uniquename="EditColumn"

then in the cs page in the RadGrid1_PreRender method i check a status flag and if its a different status then the inline form i open the window:

                    if (m_status == -3)
                    {
                        dataItem["EditColumn"].Attributes["onclick"] = "WindowOpen('addnewToDoWindow','/net/todosForm.aspx','todoid=" + dataItem["ID"].Text + "',true)";
                        dataItem["EditColumn"].Text = "<span style=\"color: #336699; text-decoration: underline;\">Edit</span>";
                    }
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Ves
Telerik team
John
Top achievements
Rank 1
Share this question
or