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

RadWindow & RadGrid Issue

3 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 18 Aug 2011, 10:35 AM
hi

I have a Radgrid and a Radwindow. The radwindows is suppose to popup whenever one click view detail link in the radgrid. Well, it worked, but the funny part was that whenever i click the page in the radgrid, the windows popup itself.  Why is that happening. Thanks and sorry if any inconvenience caused.

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        Dim windowManager As New RadWindowManager()
        Dim window1 As New RadWindow()

        If e.CommandName = "Select" Then
            Dim selectedRow As GridDataItem = DirectCast(e.Item, GridDataItem)
            Session("custid") = selectedRow.GetDataKeyValue("custid")
            window1.Width = "800"
            window1.Height = "520"
            window1.VisibleTitlebar = "false"
            window1.VisibleStatusbar = "false"
            window1.NavigateUrl = "~/custinfo.aspx?custid=" & Session("custid").ToString
            window1.ID = "RadWindow1"
            window1.VisibleOnPageLoad = True
            window1.ReloadOnShow = "true"
            ' Set this property to True for showing window from code   
            RadWindowManager1.Windows.Add(window1)
            'Page.Form.Controls.Add(widnow1)
End Sub

3 Answers, 1 is accepted

Sort by
0
Accepted
Andy Green
Top achievements
Rank 2
answered on 18 Aug 2011, 11:10 AM
I'm no expert but you might try testing for an actual data row with

If TypeOf e.Item Is GridDataItem Then

  If e.CommandName = "Select" Then .....

Andy
0
L
Top achievements
Rank 1
answered on 18 Aug 2011, 12:09 PM
hi

It is not about the data,anyway the actual data value is correct.

0
L
Top achievements
Rank 1
answered on 18 Aug 2011, 12:14 PM
hi

I know the cause. thanks
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Andy Green
Top achievements
Rank 2
L
Top achievements
Rank 1
Share this question
or