Hi all,
i want to make a small pop out windows from the cell button on the Web Grid. How can it be done? Screenshot as below:
I have an idea as below coding and i would like pass the values from the webgrid into the small windows.
Protected Sub dgResult_ClickCellButton(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.CellEventArgs) Handles dgResult.ClickCellButton
xxxxCellbutton.Attributes.Add("onclick", "window.open('popup.aspx',null,'left=400, top=100, height=250, width= 250, status=n o, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');");
End Sub
Use a template column of type hyperlink for edit ,and in dgResult_InitializeRow
e.Row.Cells.FromKey("Edit").TargetURL = "window.open('popup.aspx',null,'left=400, top=100, height=250, width= 250, status=n o, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no')";
Hi
Even I am looking for a solution in which if I clieck on hyperlink cell it should open new window with focus on it. But
this does not work.
Plz help on this
Hi Rumen,
Thanks. It worked after giving setTimeOut. I am writing the code so that it can help others
String winopen = "win=window.open('Page.aspx', \"null\",\"resizable=no,width=500,height=150\");
+ win.focus();
+ setTimeout(\"win.focus()\",1000);";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "previewscript", winopen, true);
Indeed, but this is how window.open works by default - it just opens a new window but it does not automatically set focus on it. I can suggest replacing this with a javascript function that opens the window, gets a handle to it and sets focus - all of that using javascript. Info on setting focus to a newly opened window can be found via a Google search, I believe this thread on Experts Exchange is quite good:
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_22705765.html
HTH,