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

open window from grid column hyperlink

5 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 02 Aug 2012, 10:09 AM
whats the best way to do this?

i have a column in my grid set to be a hyperlink column.

i want to be able to click on this link and launch an edit form in a radwindow that is prepopulated with the row item data.

so need a way to pass row item data to the edit form....

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Aug 2012, 10:45 AM
Hello,

You can open RadWindow in ItemCreated event using the following code.
C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
 if (e.Item is GridDataItem)
 {
    GridDataItem item = (GridDataItem)e.Item;
    HyperLink link = (HyperLink)item["UniqueName"].Controls[0];
    link.Attributes.Add("onclick", "window.radopen('EditForm.aspx'  ,'RadWindow1');
 }
Here is the demo which implements the same.

Thanks,
Princy.
0
Mark
Top achievements
Rank 1
answered on 02 Aug 2012, 10:48 AM
thanks this is 1 of 2 approaches i tried
i get this error on clicking the link

Microsoft JScript runtime error: Object doesn't support property or method 'radopen'

not sure whats wrong?
0
Princy
Top achievements
Rank 2
answered on 02 Aug 2012, 11:00 AM
Hello,

Please make sure that you have RadWindowManager on the page.
aspx:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>

Thanks,
Princy.
0
Mark
Top achievements
Rank 1
answered on 02 Aug 2012, 01:30 PM
ok thanks,

now got a different error referring to a control in the project but it doesnt appear in the pages concerned with this grid and window...

The control with ID 'uxOwnerships' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

can i not use an existing radwindow defined in the page already that has the edit form within it?

open this and pass the relevant parameters i need somehow?
0
Mark
Top achievements
Rank 1
answered on 02 Aug 2012, 02:20 PM
I guess the issue im having is if i launch the edit form as a url , ie a new webform i have to repeat all the existing code, css, validation, updating etc in here... so im reluctant to use the radopen way of doing this...

whereas if i can launch it within a radwindow (with the form layout)  already defined in the page then existing methods can be utilised.

basically this updating process was done from a form on the same page, to save space this form now needs to be a popup. 

the following achieves this, but im not sure how  i pass multiple parameters across to it.

oWnd = $find("<%=pBlocks.ClientID%>"); 

 

oWnd.show();


Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Share this question
or