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

InlineInsertTemplate Resource binding problem

1 Answer 52 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sekowski
Top achievements
Rank 1
Sekowski asked on 13 Apr 2015, 09:18 AM
Hello,
I have problem with resources in Telerik scheduler custom template, to be specific InlineInsertTemplate.

I don't use separate ascx file for appointment layout.
Everything is in one aspx file and one cs file.

I can find the controls with resources and their values,in RadScheduler1_AppointmentCommand command insert I can put them inside a test label and the values are correct.
I make global public variables from resources so I should be able to add manually the resources but I tried many things and everything failed.

Main problem is i can not add resources. In default template everything works fine, resources are added to database.

Some of my tries:


protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
    if (e.Container.Mode == SchedulerFormMode.Insert)   
        {
    Resource resPracownik = new Resource();//i create manually resource
    resPracownik.Key = "Pracownik";
    resPracownik.Text = TextBoxPracownik.ToString();
    e.Appointment.Resources.Add(resPracownik);//this doesn't
    
    TextBox TitleTextBox = (TextBox)e.Container.FindControl("TitleTextBox");
    TitleTextBox.Text = e.Appointment.Subject;//this works

protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
    {
    if (e.CommandName == "Insert"){
            RadComboBox RadComboBoxPracownik = (RadComboBox)e.Container.FindControl("RadComboBoxPracownik");//finding combobox withj resource value
            TextBox TextBoxPracownik = (TextBox)e.Container.FindControl("TextBoxPracownik");//finding hidden helping text box
            TextBoxPracownik.Text = RadComboBoxPracownik.SelectedItem.Value.ToString();//setting text box value same as combobox so i can easier bind it
            tempPracownik = RadComboBoxPracownik.SelectedItem.Value.ToString();//setting global variable
            
            Label1.Text = "status= " + tempStatus + "\npracownik= " + tempPracownik + "\ntyp= " + tempTyp;//this shows that the values are correct, the just dont bind

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 13 Apr 2015, 01:20 PM
Hi,

In case when Custom Advanced Template is used and you need to need to use Resources with RadComboBox we strongly recommend using the separate usercontrol as for example it is done in the demo and in the sample page here.

Regards,
Plamen
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Scheduler
Asked by
Sekowski
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or