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

Launch popup edit formtemplate from code behind

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jlj30
Top achievements
Rank 2
jlj30 asked on 07 Mar 2012, 07:40 PM
I would like to be able to navigate from several spots within my application and open up the edit formtemplate for a particular row in a RadGrid on another page.  I can pass the key thru a session variable.
When the page loads, I would like the edit formtemplate (a popup) to automatically open with the data presented for the row with the passed key.

Any guidance on an approach to accomplish this would be greatly appreciated.

My alternative is to duplicate the rather complex formtemplate on other pages; something I'd rather not do.

Thanks in advance.

Jim

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 08 Mar 2012, 10:33 AM
Hello,

I guess your requirement is to make the Radgrid in edit mode based on the Key value that you passed through session. If so please try the following code.
C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
 if (!Page.IsPostBack)
 {
  foreach (GridDataItem item in RadGrid1.Items)
  {
   if (Session["OrderID"].ToString() == item.GetDataKeyValue("OrderID").ToString())
   {
    item.Edit = true;
    RadGrid1.Rebind();
   }
  }
 }
}

-Shinu.
Tags
Grid
Asked by
jlj30
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Share this question
or