Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
42 views
I have a Radcombobox that is bind from the database.
i have put the following properties TRUE
ShowMoreResultsBox=true
EnableVirtualScrolling=true
EnableLoadOnDemand=true
ItemPerRequest=20
it works fine.
Suppose i add a Employee record. on the Employee add form there is a Radcombobox that have the Cities filled with it from the City table in database. when i click on the Radcombobox with each request next 20 cities are shown, its fine. Selected city suppose "California" is selected and inserted in database.
now when i come in edit mode i write down the code to select the california that was already added in database.
RadCombobox1.SelectedValue=20;  //California State ID from the database.
but it is not shown by default unless we click on the radCombobox.
I want that Seleceted state should be displayed by default and as well as pagination should be worked with above mentioned properties.

 
Ivana
Telerik team
 answered on 06 Sep 2011
1 answer
51 views
Hi there,

At the moment I am working with recourses. I have 2 agenda's in my scheduler now. But I have a problem. I am working with schemes. And one person has another scheme than another person. When a person clicks on a timeslot I have to check if the person create an appointment and not outside of that scheme. How can I get the timeslot resource key when clicking on a timeslot? I need it in C#.

I hope someone can help me.

Thanks in advance.

Sander
Ivana
Telerik team
 answered on 06 Sep 2011
1 answer
131 views
Hi,
I'm using RadScheduler control with AdvancedInsertTemplate and AvancedEditTemplate.
I'm using the same ascx to declare the template, and when I create an Appointment it works correctly, but when I try to edit it or another appointment I don't find the new values in e.ModifiedAppointment object but in e.Appointment.

I've fired the event AppointmentCommand e AppointmetInsert, AppointmentUpdate.
In the first event I check the CommandName to find the correct template in which find the controls (eg: textbox, dropdownlist)
After fire the   AppointmetInsert and it works.

In EditMode this not works.

This is my ASCX codebehind

/// <summary>
/// Restituisce o imposta la modalità di accesso alla form
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public SchedulerFormMode Modalita { get; set; } // qui non è necessario usare il viewstate perchè non viene agganciata da un datareader
/// <summary>
/// Restituisce o imposta il titolo della form
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string FormTitle { get; set; } // qui non è necessario usare il viewstate perchè non viene agganciata da un datareader
/// <summary>
/// Restituisce o imposta l'id dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public int AppointmentId
{
    get { return Convert.ToInt32(this.ViewState["AppointmentId"]); }
    set { this.ViewState["AppointmentId"] = value; }
}
/// <summary>
/// Restituisce o imposta l'oggetto dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Subject
{
    get { return this.ViewState["Subject"].ToString(); }
    set { this.ViewState["Subject"] = value; }
}
/// <summary>
/// Restituisce o imposta l'autore dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Author 
{
    get { return this.ViewState["Author"].ToString(); }
    set { this.ViewState["Author"] = value; }
}
/// <summary>
/// Restituisce o imposta a descrizione dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Description
{
    get { return this.ViewState["Description"].ToString(); }
    set { this.ViewState["Description"] = value; }
}
/// <summary>
/// Restituisce o imposta la data e l'ora di inizio dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public DateTime Start
{
    get { return Convert.ToDateTime(this.ViewState["Start"]); }
    set { this.ViewState["Start"] = value; }
}
/// <summary>
/// Restituisce o imposta la data e l'ora di fine dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public DateTime End
{
    get { return Convert.ToDateTime(this.ViewState["End"]); }
    set { this.ViewState["End"] = value; }
}
/// <summary>
/// Restituisce o imposta la regola di ripetizione dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string RecurrenceRule
{
    get { return this.ViewState["RecurrenceRule"].ToString(); }
    set { this.ViewState["RecurrenceRule"] = value; }
}
/// <summary>
/// Restituisce o imposta la regole di promemoria dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Reminders
{
    get { return this.ViewState["Reminders"].ToString(); }
    set { this.ViewState["Reminders"] = value; }
}
 
And this are the three events in ASPX code behind

protected void Scheduler_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
    SchedulerTask taskToEdit = Scheduler[Convert.ToInt32(e.Appointment.ID)];
    taskToEdit.Comments = e.ModifiedAppointment.Description;
    taskToEdit.StartTime = e.ModifiedAppointment.Start;
    taskToEdit.EndTime = e.ModifiedAppointment.End;
    taskToEdit.Subject = e.ModifiedAppointment.Subject;
    taskToEdit.Tipologia = e.ModifiedAppointment.Resources.GetResourceByType("Tipologia") != null ?
        (TipologiaTask)Convert.ToInt32(e.ModifiedAppointment.Resources.GetResourceByType("Tipologia").Key) : TipologiaTask.Varie_Note;
    taskToEdit.Reminder = e.ModifiedAppointment.Reminders.ToString();
    taskToEdit.Recurrence = e.ModifiedAppointment.RecurrenceRule;
    taskToEdit.RecurrenceParentID = e.ModifiedAppointment.RecurrenceParentID;
    taskToEdit.Stato = StatoTask.MODIFICA;
      
    taskToEdit.Salva();
    this.schGestioneLocazioni.DataSource = Scheduler.CopyToDataTable();
}
 
protected void Scheduler_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
{
    try
    {
        // recupero la tipologia selezionata dall'utente tramite la finestra modale di editing
        // se non ha impostato nulla imposto io una tipologia di default
        TipologiaTask tipologia = e.Appointment.Resources.GetResourceByType("Tipologia") == null ?
            TipologiaTask.Property_Management_Note : (TipologiaTask)Convert.ToInt32(e.Appointment.Resources.GetResourceByType("Tipologia").Key);
          
        string autore = e.Appointment.Attributes["Autore"] == null ?
            SchedulerConstants.Autori.SCH_AUTORE_SYS : e.Appointment.Attributes["Autore"].ToString();
 
 
        SchedulerTask taskToAdd = Scheduler.NewSchedulerTask(
                                    e.Appointment.Subject,                  // oggetto
                                    e.Appointment.Description,              // descrizione
                                    e.Appointment.Start,                    // inizio
                                    e.Appointment.End,                      // fine
                                    tipologia,                              // tipologia
                                    e.Appointment.Reminders.ToString(),     // promemoria (basta fare il ToString della Collection e ottengo il reminder formattato
                                    e.Appointment.RecurrenceRule,           // regola di ricorrenza   
                                    e.Appointment.RecurrenceParentID,       // parent ID
                                    StatoTask.INSERIMENTO,
                                    SchedulerTaskAvvisato.NO,
                                    autore,
                                    DateTime.Now);
 
 
        Scheduler.Add(taskToAdd);
        this.schGestioneLocazioni.DataSource = Scheduler.CopyToDataTable();
        RadAjaxManager.GetCurrent(this).Alert("Appointment was inserted successfully.");
    }
    catch (SqlForeignKeyConstraintException ex)
    {
        RadAjaxManager.GetCurrent(this).Alert(ex.Message);
    }
    catch (SqlException ex)
    {
        RadAjaxManager.GetCurrent(this).Alert(ex.Message);
    }
    catch (Exception)
    {
        RadAjaxManager.GetCurrent(this).Alert(MessaggiException.Exception);
    }
}
 
 
protected void Scheduler_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
{
    Control SchedulerAdvancedForm;
    switch (e.CommandName.ToLower())
    {
        case "insert":
            SchedulerAdvancedForm = e.Container.FindControl("advTemplateInsert"); break;
        case "update":
            Scheduler.ReadTasks();  // rileggo per avere eventuali nuove task inserite sul db
            SchedulerAdvancedForm = e.Container.FindControl("advTemplateEdit"); break;
        default:
            SchedulerAdvancedForm = e.Container.FindControl("advTemplateInsert"); break;
    }
 
    if (SchedulerAdvancedForm != null)
    {
        e.Container.Appointment.Subject = ((RadTextBox)SchedulerAdvancedForm.FindControl("txtAdvInsertSubject")).Text;
        e.Container.Appointment.Description = ((RadTextBox)SchedulerAdvancedForm.FindControl("txtAdvInsertDescription")).Text;
        e.Container.Appointment.Attributes["Autore"] = ((RadTextBox)SchedulerAdvancedForm.FindControl("txtAdvInsertAuthor")).Text;
        e.Container.Appointment.Start = ((RadDateTimePicker)SchedulerAdvancedForm.FindControl("rtpAdvInsertStartTime")).SelectedDate.Value;
        e.Container.Appointment.End = ((RadDateTimePicker)SchedulerAdvancedForm.FindControl("rtpAdvInsertEndTime")).SelectedDate.Value;
          
    }
}

Where I wrong?

Best Regards
Plamen
Telerik team
 answered on 06 Sep 2011
2 answers
51 views
Hi there,

I'm using a custom GridTemplateColumn to do some filtering. The filter combo-box is bound to a Dictionary<int, string> and renders with no problems; it's bound with:

            rcBox.DataTextField = "value";
            rcBox.DataValueField = "key";

When I try to select an item from the list however, I get an error message "Expression expected" with the following code:

        private void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }

The code was previously:

        private void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair("EqualTo", this.UniqueName));
        }

but that also gives "Expression Expected" with a UniqueName value of "key".

Any thoughts?

Thank you,

Mike K.
Mike
Top achievements
Rank 1
 answered on 06 Sep 2011
1 answer
210 views
Hi,

1)   I have a master page that contains the following controls:
      <telerik:RadAjaxManager id="RadAjaxManager" runat="server" EnablePageMethods="True" />
      <telerik:RadAjaxLoadingPanel id="DefaultLoadingPanel" runat="server" />

2)   My content page contains:
      <telerik:RadPanelItem Value="CourseControl" Text="Courses"><ContentTemplate>...</ContentTemplate></telerik:RadPanelItem>
      <telerik:RadAjaxManagerProxy id="CourseRadAjaxManagerProxy" runat="server">
         <AjaxSettings>
          <telerik:AjaxSetting AjaxControlID="CourseGrid">
           <UpdateControls>
            <telerik:AjaxUpdateControl ControlID="CourseGrid" LoadingPanelID="DefaultLoadingPanel" />
           </UpdateControls>
          </telerik:AjaxSetting>
         </AjaxSettings>
      </telerik:RadAjaxManagerProxy>

3)   My User Control known as CourseControl in the above RadPanelItem contains the following control:
       <UC1:CourseGrid id="CourseGridControl" runat="server">

4)   My CourseGrid user control which is a generic grid used by multiple user controls has a Javascript function to open a popup window (AddEditCourse.aspx) which helps users manage the courses.
 
The problem is when a new course is added to the database or an existing course is updated I am unable to refresh the grid so that the changes be visible to the user. In the CloseAndRebind() function located in the popup window, I use top.location.href = top.location.href. This refreshes the grid but it refreshes the entire page while I only want to refresh only the grid.

Complete Root: MasterPage->Couses.aspx->CoursesUC.ascx->CourseGrid.ascx->AddEditCourse.aspx

Can someone please point me in the right direction? I would appreciate if you could provide me some code sample.

Thank you in advance.

Luc
Tsvetina
Telerik team
 answered on 06 Sep 2011
1 answer
118 views
Hi,
On editing single reccurrence  AppointmentInsert  handler is fired  to add a new appointment for the exception, and the RecurrenceParentid for this appointment is set to the id of the parent recurring appointment.
So, On editing single reccurrence i am able to insert new one with same id as of parent Appointment and new appointment shows in the schedular, but i am still not able to get image of exception appointment. it just show it as normal recurring appointment.is any other recurrence rule will be generated in acse of editing indivisual appointment ?
Also if i edit while series of recurrence and i click on the reset exception link  then it is not deleting the new entry added but restore previously edited indivisual appointment making it two appointment on same day. One of recursive and one exceptional.
I am attaching screenshots of Problem. Appointment Delete event does not fire on clicking link resetException link.
Pls Reply..


Thanks
Peter
Telerik team
 answered on 06 Sep 2011
3 answers
98 views
Hi!

My customer has a request to skip the calander popupbutton of the datepicker on tab. So if I have 2 datepickers and the textbox of the first datepicker has focus and I press tab, I want the textbox of the second datepicker to get focus. What I've been trying to do so far, is  to trigger a keydown event with the tab key on the focus event of the popupbutton. I was doing this with jquery. But so far it's not working at all.
Do you know how to accomplish this with jquery or javascript?

Thanks in advance.
Datamex
Top achievements
Rank 2
 answered on 06 Sep 2011
3 answers
131 views
I have 2 radgrids on my page, both bound with entity data sources. The second grid's data source uses a WHERE clause to filter the set by a parent/foriegn key.  The second grid is cofigured for allow inserts/updates/deletes on both the data source and radgrid. When I insert a record on the second grid I would like to pass the key field from the first grid to the foreign key on the second.  I have seen several examples to do this but even when a value is successfully passed to the edit column textbox, I get an Entity error that the foreign key is null. Can someone help with this or is this an Entity Framewwork issue?
Tsvetina
Telerik team
 answered on 06 Sep 2011
7 answers
153 views
Hi,
Is this recurrence rule is exceptional:
DTSTART:20110907T183000Z
DTEND:20110908T083000Z
RRULE:FREQ=WEEKLY;COUNT=5;INTERVAL=1;BYDAY=MO,TU
EXDATE:20110911T183000Z

as it is not coming to RecurrenceState.Exception in appointment_created event of radschedular.
my schedular is working fine except on editing indivisual appointment of recurring appointment it doesnot show that appointment again on editing as it never comes to exceptional state in Appointment_created event.
I am attaching the xml and my code of schedular,
Pls Help.........

Thanks
Dan Lehmann
Top achievements
Rank 1
 answered on 06 Sep 2011
1 answer
76 views

I have a masterpage with menu items and a content page inside a telerik ajax pannel. The master page does not have any ajax pannels.  I need to disable and enable menu items in the masterpage from the contentpage and the ajax pannel as user clicks the items inside the ajax panel.  What is the best method to update the masterpage contents. 
Princy
Top achievements
Rank 2
 answered on 06 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?