
Hi,
I am wondering how I can update combobox's text on Ajax postback. I have tried using AjaxManager and AjaxPanel, but none of them worked. I am using 2008 Q2 trial. Here are what I have:
Using AjaxManager
[ASPX]
<telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true"
RadComboBoxImagePosition="Left" Text="" AutoPostBack="true"
OnSelectedIndexChanged="OnComboSelectedChange" Runat="server" >
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadComboBox>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadComboBox1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
[C#]
protected void OnComboSelectedChange(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
RadComboBox1.Text = RadComboBox1.SelectedIndex.ToString();
}
Using AjaxPanel
[ASPX]
<telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server">
<telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true"
RadComboBoxImagePosition="Left" Text="" AutoPostBack="true"
OnSelectedIndexChanged="OnComboSelectedChange" Runat="server" >
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadComboBox>
</telerik:RadAjaxPanel>
[C#]
protected void Page_PreRender(object sender, EventArgs e)
{
if (RadAjaxPanel3.IsAjaxRequest)
{
RadComboBox1.Text = RadComboBox1.SelectedIndex.ToString();
}
}
| Private Const AppointmentsLimit As Integer = 1 |
| Protected Function ExceedsLimit(ByVal apt As Appointment) As Boolean |
| Dim appointmentsCount As Integer = RadScheduler1.Appointments.GetAppointmentsInRange(apt.Start, apt.End).Count |
| Return (appointmentsCount > (AppointmentsLimit - 1)) |
| End Function |
| Protected Function OccupazioneAule(ByVal apt As Appointment, ByVal scheduler As RadScheduler) As Boolean |
| For Each ResourceAule As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(apt.Start, apt.[End]) |
| For Each ResourceAuleApt As Resource In ResourceAule.Resources.GetResourcesByType("Aule") |
| For Each res As Resource In apt.Resources.GetResourcesByType("Aule") |
| If ResourceAuleApt.Key.Equals(res.Key) Then |
| Return True |
| End If |
| Next |
| Next |
| Next |
| Return False |
| End Function |
| Protected Sub RadScheduler1_AppointmentInsert(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerCancelEventArgs) Handles RadScheduler1.AppointmentInsert |
| If ExceedsLimit(e.Appointment) And OccupazioneAule(e.Appointment, RadScheduler1) Then |
| RadAjaxManager1.ResponseScripts.Add("radalert('Aula giĆ prenotata, riprovare!!', 300, 180);") |
| e.Cancel = True |
| Else |
| If ExceedsLimit(e.Appointment) Then |
| RadAjaxManager1.ResponseScripts.Add("radalert('Aula giĆ prenotata, riprovare!!', 300, 180);") |
| e.Cancel = True |
| End If |
| End If |
| End Sub |
| Protected Sub RadScheduler1_AppointmentUpdate(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentUpdateEventArgs) Handles RadScheduler1.AppointmentUpdate |
| If ExceedsLimit(e.ModifiedAppointment) Then |
| For Each a As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.[End]) |
| If a.ID <> e.Appointment.ID Then |
| e.Cancel = True |
| End If |
| Next |
| End If |
| End Sub |
There were four add-ons that apparently auto-installed themselves when I installed the software for the HP printer that is attached locally to Tracyās PC. He disabled those add-ons and everything works fine now. Apparently they were conflicting in some way. I thought maybe you could use the information to help figure out the similar issue you mentioned with another customer.
The add-ons were:
HP Clipbook ā Browser Extension
HP Print Clips ā Browser Helper Object
HP Print Enhancer ā Browser Helper Object
HP Smart Select ā Browser Extension
Of course, I donāt know which one caused the problem, but I donāt intend to re-enable any of them.
Error parsing near ' <!DOCTYPE html P'.
The very odd thing is this: I ONLY get this error if there is complicated HTML text within the RadEditor at the top of the page. If this Editor is empty, then the error does not occur. I have tested this over and over again, always with the same results. If there is just plain text in the editor, I do not get ParserErrorException. If there is more complicated html that I have pasted into the Editor previously and saved to the database, that has now been loaded into the Editor, I always get the exception when I press one of the buttons in the uploadpanel below it for the first time after I have loaded the page.