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

RadGrid Button to Open RadWindow

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 11 May 2012, 06:50 AM
Hi All -- I've got a RadGrid with a Button on it that is supposed to launch a RadWindow using radopen, but doesn't seem to be doing the trick. I've followed some of the tutorials on the site, but just having absolutely no luck. Here's what I've got so far:

.ASPX
<script type="text/javascript">
        function openWin() {
            radopen(null, "RadWindow1");
        }
    </script>

Code Behind
Private Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If TypeOf e.Item Is Telerik.Web.UI.GridDataItem Then
            Dim dataItem As Telerik.Web.UI.GridDataItem = DirectCast(e.Item, Telerik.Web.UI.GridDataItem)
            Dim btnImage As Button = DirectCast(dataItem("column2").Controls(0), Button)
            btnImage.Attributes.Add("OnClick", "openWin(); return false;")
        End If
End Sub

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 May 2012, 05:42 AM
Hello Jerry,

I also tried the same code which worked as expected in my end. Please make sure that you have RadWindowManager on the page.
aspx:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server"></telerik:RadWindow>
   </Windows>
</telerik:RadWindowManager>

Thanks,
Shinu.
Tags
Grid
Asked by
Jerry
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or