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

[Solved] RadWindow causing strange behavior in screen updates.

2 Answers 161 Views
Window
This is a migrated thread and some comments may be shown as answers.
aea13
Top achievements
Rank 1
aea13 asked on 18 Feb 2008, 11:17 PM

Howdy,  I have a webform with a radscheduler (setup.aspx), code has the following javascript to intercept an appointment click and load additional data in a radwindow (setuppopup.aspx).  Setuppopup.aspx executed/behaved perfectly fine when running on its own (i.e. not inside a radwindow).  However, now, a dropdownlist isn't getting selected anymore, and a button that transfers values from a textbox to a listbox seems to duplicate all the values that it transfers.

In Setup.aspx:

        <script type="text/javascript">
        function ShowDetails(sender, eventArgs)
        {
            var id = eventArgs.get_appointment().ID;
            var stringUrl = "SetupPopUp.aspx?ID=" + id;
            var popup = radopen(stringUrl);
            popup.setSize(800,750);
            popup.Center(); 
        } 
        </script>


 <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
 </telerik:RadWindowManager>

In SetupPopUp.aspx.vb

    Private Sub GrabSQLMeetingInfo(ByVal MDBid As Int32)

        Dim Conn As New SqlConnection(ConStr)
        Conn.Open()
        Dim cmd As New SqlCommand("GetMeetingByID", Conn)
        Dim reader As SqlDataReader = Nothing

        Try
            cmd.CommandType = Data.CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@MDBid", MDBid)
            reader = cmd.ExecuteReader(CommandBehavior.SingleRow)
            If Not reader Is Nothing Then
                While reader.Read
                    Session("MeetingID") = reader.GetInt32(0)
                    Dim meetcontact As String = reader.GetString(3)
                    lblPresenter.Text = meetcontact
                    For Each li As ListItem In ddlPresenter.Items
                        If li.Value = meetcontact Then
                            li.Selected = True
                        End If
                    Next
                    'grabs other data that shows up fine in labels
                End While
            Else
            End If
        Catch ex As Exception
        Finally
            cmd.Dispose()
            Conn.Close()
        End Try
    End Sub

ddlpresenter (dropdownlist) is tied to a sqldatasource control, textvalue is "firstname, lastname", valuefield is "username".  sql side for the record being pulled by MDBid variable above only has the 'username' stored.  lblpresenter shows that the correct value is being pulled, the ddlpresenter however doesn't seem to respond.

The button that is supposed to parse the textbox and spit out to a listbox does the following:

  Private Sub FromStringToList(ByVal parsing As String)

        If parsing.Length > 0 Then
            Dim myArray() As String = Nothing
            myArray = parsing.Split(Environment.NewLine)
            Dim count As Integer = 0
            For z As Integer = 0 To myArray.Length - 1       'last one is an empty place, so ignore it
                Try
                    lbGuestsPending.Items.Add(Trim(myArray(z).ToString))
                    count = count + 1
                Catch ex As Exception
                End Try
                uT.Color(lblNameAdded, Drawing.Color.Yellow, Drawing.Color.Green, "Added " & count & " name(s)")
            Next
        End If
    End Sub

The button click seems to be occuring twice now.

Incidentally, the lbGuestPending has its values loaded in the reader referenced above, after the ddlpresenter control is supposed to have its value selected, without problems.

Please let me know what i'm missing.

Thank you in advance.

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 19 Feb 2008, 02:56 PM
Hi aea13,

I am afraid that at this point we cannot say what the reason for the problem might be. Can you please open a new support ticket and send us a small sample project where the problem can be reproduced? We will check it and provide you with solution right away.



Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
aea13
Top achievements
Rank 1
answered on 19 Feb 2008, 03:54 PM
Thanks for at least looking Georgi.

I did some more testing this morning and finally got it to work by storing the presenter variable from the database in a session variable, doing the selection in the 'databound' event of the ddlpresenter, and lastly, setting the radwindowmanager's (in setup.aspx) "ReloadOnShow" property to True.  Without that last step the first steps didn't matter, and without the first steps, the last one didn't either....

Unfortunately the 'double click' thing didn't get fixed, i went around it by just clearing the textbox that was the source of the 'parsing' variable in the FromStringToList(byval parsing as string) sub at the end of that sub.  Strangely, i was already clearing the textbox right after the call to this same FromStringToList(...) sub, it just seemed to get ignored the first time around.

Sometimes I think this ajax stuff is more hassle than its worth ;)
Tags
Window
Asked by
aea13
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
aea13
Top achievements
Rank 1
Share this question
or