public override void Update( RadScheduler owner, Appointment appointmentToUpdate ) { |
HL_Appointment app = GetDBAppointment( appointmentToUpdate ); |
if( app != null ) { |
app.End = appointmentToUpdate.End; |
int redParID = 0; |
if( appointmentToUpdate.RecurrenceParentID != null && int.TryParse( appointmentToUpdate.RecurrenceParentID.ToString(), out redParID ) ) |
app.RecurrenceParentID = redParID; |
app.RecurrenceRule = appointmentToUpdate.RecurrenceRule; |
app.Start = appointmentToUpdate.Start; |
app.Subject = appointmentToUpdate.Subject; |
ReadyUpdateAppointmenRessources( appointmentToUpdate ); |
db.SubmitChanges(); |
} |
} |
<
div
id
=
"foo"
/>
OnClientBeforeShow = "AddModal";
OnClientBeforeClose = "RemoveModal";
//Bug -- IE removes 'TopBar' when closing a modal, content template RadWindow. Circumvent by removing the property right before close.
function
AddModal(radWindow) {
radWindow.set_modal(
true
);
}
function
RemoveModal(radWindow) {
radWindow.set_modal(
false
);
}
Good day;
It seems that the postback texchanged event of a radinput(textbox) control interferes with opening a radwindow as a popup. The net effect is that the window (dialog) will open and close automatically.
Unfortunatley; copyright laws prevent me from posting the source but I will do my best to explain it correctly.
I'm working on a user control composed of:
- RADINPUT(TEXTBOX) (autopostback off)
- ASP IMAGE BUTTON
- RAD WINDOW object, set to modal, with the navigateurl set to "dialog.aspx", linked to the ASPIMAGEBUTTON via OpenerElementID
The Popup page, say dialog.aspx is composed mainly of:
- Textbox to enter search value
- asp image button - triggers off the search
- radgrid to display the results
The objective of the control is to provide a text thats tied to a search dialog. If the user doesnt know the value they can search for it via the dialog, select the value they want and bring it back to the text box.
Everything works well and is awesome. Except, a new requirement came in. God wants whatever text that users type in the textbox of the user control come across to the search dialog window and be defaulted into the textbox for the search. Perfectly reasonable.
In order to achieve this I added a querystring value to carry the value from the textbox into the dialog.aspx. In order to modify the navigateurl of the radwindow I added codebehind to the textchanged event of the user control textbox and turned on its autopostback. Mostly it works....however.....there is one scenario where I believe the postback from the textbox control is interfering with the rad windows opening.
The scenario is:
Enter text into the textbox; without tabing out or hitting enter; click on the image button.
The action above should cause the following in order:
1. Run textbox.textchanged event and Update the navigateurl of the radwindow.
2. Open the rad window dialog.
What actually happens is that the radwindow opens and closes. If I click on the image to open it again, it seems the navigateurl did not get updated by the textbox event. In other words, it seems that clicking on the button while the focus is still on the textbox causes the postback from the textbox to get shorted and the opening of the dialog to be aborted.
I have managed to work around this by turning off the textbox's autopostback and adding some client side code. However, if in the future we need to activate the autopostback for the textcontrol in order to manage the textchanged event on any asp that implements it the problem will resurface.
Thanks in advance for the help;
David
Private Sub RadGrid2_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid2.InsertCommand
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim isCustCode As Boolean = False
'Dim intAutoNumber As Integer = CType(editedItem.FindControl("AutoNumber"), TextBox).Text
'Dim strActivity As String = CType(editedItem.FindControl("Activity"), TextBox).Text
Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
Dim CustC As String = CType(MyUserControl.FindControl("rcCustomer"), RadComboBox).Text
Dim CustAN As String = CType(MyUserControl.FindControl("rcCustomer"), RadComboBox).SelectedValue
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
dsCustomers.Clear()
Dim strSPName1 As String = ""
If (Session("SalesPersonID") = "0" And Session("CSRID") <> "0") Or Session("SalesPersonID") = "999" Or Session("EstimatorID") <> "0" Then
strSPName1 = "GetCustomersActivity"
ElseIf Session("SalesPersonID") <> "0" Then
strSPName1 = "GetCustomersActivitySales"
End If
If strSPName1 = "" Then
strSPName1 = "GetCustomersActivity"
End If
Dim cmd1 As New SqlCommand(strSPName1, myConnection2)
cmd1.CommandType = CommandType.StoredProcedure
If (Session("SalesPersonID") = "0" And Session("CSRID") <> "0") Or Session("SalesPersonID") = "999" Or Session("EstimatorID") <> "0" Then
ElseIf Session("SalesPersonID") <> "0" Then
cmd1.Parameters.Add(New SqlParameter("@SalesPersonID", Session("SalesPersonID")))
End If
dtAdapter2.SelectCommand = cmd1
dtAdapter2.Fill(dsCustomers)
dvCustomers = New DataView(dsCustomers.Tables(0))
Me.dvCustomers.AddNew.Item("CustName") = " "
Me.dvCustomers.AddNew.Item("CustName") = " "
Me.dvCustomers.Sort = "CustName"
Me.dsCustomers.AcceptChanges()
rcCustomer.ClearSelection()
rcCustomer.DataTextField = "CustName"
rcCustomer.DataValueField = "CustName"
rcCustomer.DataSource = dvCustomers
rcCustomer.DataBind()
End Sub