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

open window from codebehind

1 Answer 50 Views
Window
This is a migrated thread and some comments may be shown as answers.
Eva
Top achievements
Rank 1
Eva asked on 07 Jun 2011, 06:47 PM

How secure to open a rad window from javascript? You can get the querry string url from viewsource?

How to open a rad winndow from code behind in radgrid edit/add button click. It should be in RadGrid1_ItemCreated.

Need help ASAP.

Thanks.
Eva

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 08 Jun 2011, 07:40 AM
Hello Eva,

Try the following approach to open a window in Edit button click.

C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
   {
            GridEditableItem item = (GridEditableItem)e.Item;
            TableCell cell = item["ColumnUniqueName"];
            RadWindow window1 = new RadWindow();
            window1.NavigateUrl = "www.google.com";
            window1.VisibleOnPageLoad = true;
            window1.Width = 400;
            window1.Height = 500;
            cell.Controls.Add(window1);
      }
 }

In order to open a window from javascript, try the following method.

aspx:
<telerik:RadWindowManager ID="window1" runat="server">
<Windows>
     <telerik:RadWindow ID="RadWindow1" runat="server">
     </telerik:RadWindow>
</Windows>
</
telerik:RadWindowManager>
<asp:Button ID="Button1" runat="server" OnClientClick="OnClientClick();return false;" Text="Button" />

Javascript:
function OnClientClick()
 {
  var window = $find('<%= RadWindow1.ClientID %>');         
  var window = radopen("http://www.gogle.com", null);
 window.show();
 }


Thanks,
Princy.
Tags
Window
Asked by
Eva
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or