or

| protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) |
| { |
| //if the event takes place before today, cancel, preferably with an error message |
| //if the resources are left empty, cancel, preferably with an error message |
| if (e.Appointment.Start <= DateTime.Now) |
| { |
| e.Cancel = true; |
| } |
| } |
| protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e) |
| { |
| //if the event takes place before today, cancel, preferably with an error message |
| //if the resources are left empty, cancel, preferably with an error message |
| if (e.ModifiedAppointment.Start <= DateTime.Now) |
| { |
| e.Cancel = true; |
| } |
| } |

| <telerik:RadComboBox ID="radComboBoxPLZ" Runat="server" Width="50px" DropDownWidth="260px" MaxHeight="200px" |
| OnItemsRequested="radComboBoxPLZ_ItemsRequested" EnableLoadOnDemand="true" MarkFirstMatch="true" |
| CollapseDelay="100" TabIndex="1"> |
| <HeaderTemplate> |
| <table style="width: 220px" cellspacing="0" cellpadding="0"> |
| <tr> |
| <td style="width: 40px;"> |
| PLZ</td> |
| <td style="width: 120px;"> |
| Gemeinde</td> |
| <td style="width: 20px;"> |
| Kanton</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table style="width: 220px" cellspacing="0" cellpadding="0"> |
| <tr> |
| <td style="width: 40px;"> |
| <%# DataBinder.Eval(Container, "Text")%> |
| </td> |
| <td style="width: 120px;"> |
| <%# DataBinder.Eval(Container, "Attributes['Gemeinde']")%> |
| </td> |
| <td style="width: 20px;"> |
| <%# DataBinder.Eval(Container, "Attributes['Kanton']")%> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| protected void radComboBoxPLZ_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) |
| { |
| if (e.Text.Length < 1) |
| return; |
| string sqlSelectCommand = string.Format("Select p.PLZ, k.Gemeinde, k.Kanton from AAV_TEST_PLZ_ORTE_GEMEINDE p, AAV_TEST_GEMEINDE_KANTON k where p.KANT_GEM_ID = k.ID and p.PLZ LIKE '{0}%' ORDER BY p.PLZ", e.Text); |
| DataTable dataTable = null; |
| using (OleDbDataAdapter adp = new OleDbDataAdapter(sqlSelectCommand, AdresssucheParameter.ConnectionString)) |
| { |
| dataTable = new DataTable(); |
| adp.Fill(dataTable); |
| } |
| foreach (DataRow dataRow in dataTable.Rows) |
| { |
| RadComboBoxItem item = new RadComboBoxItem(); |
| item.Text = (string)dataRow["PLZ"]; |
| item.Value = dataRow["PLZ"].ToString(); |
| //zusätzliche Spalten |
| item.Attributes.Add("Gemeinde", dataRow["Gemeinde"].ToString()); |
| item.Attributes.Add("Kanton", dataRow["Kanton"].ToString()); |
| radComboBoxPLZ.Items.Add(item); |
| item.DataBind(); |
| } |
| } |
string
plz = e.Context["FilterStringPLZ"].ToString();
I'm looking for an solutin since 2 days and can't find an answer. It's very frustrating because I'm testing with yout Trial Version - when it looks good, we would like to pay the software.
Thanks for your anser! Bye
| User-agent: IE8.0 |
| Location: Telerik.Web.UI.WebResourceError |
| Description: System.NullReferenceException: Object reference not set to an instance of an object. |
| at Telerik.Web.UI.CombinedScriptWriter.GetContentType(List`1 scriptEntries) |
| at Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile() at Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context) |
| at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() |
| at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Stack trace: |
| at Telerik.Web.UI.CombinedScriptWriter.GetContentType(List`1 scriptEntries) |
| at Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile() |
| at Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context) |
| at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() |
| at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) |