Attributes

2 posts, 0 answers
  1. Michel Laforce
    Michel Laforce avatar
    10 posts
    Member since:
    Apr 2010

    Posted 02 Oct 2011 Link to this post

    Hi

     

    EnableCustomAttributeEditing="true"

     

     

    CustomAttributeNames="Color

     


    I have added an attribute wich I Bind and it work fine

     

    protected void rdsSchedule_FormCreated(object sender, SchedulerFormCreatedEventArgs e)

     

    {

     

    if((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))

     

    {

    ddlColor.SelectedValue = e.Appointment.Attributes[

    "Color"];

     

    }

    }

    but it is empty in the update, my database receives an empty string for Color

     

     

    protected void rdsSchedule_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)

     

    {

     

    this.SqlProcessor.AddParameter("ID", e.Appointment.ID);

     

     

    this.SqlProcessor.AddParameter("Users_ID", this.CurrentUserId);

     

     

    this.SqlProcessor.AddParameter("Subject", e.ModifiedAppointment.Subject);

     

     

    this.SqlProcessor.AddParameter("Description", e.ModifiedAppointment.Description);

     

     

    this.SqlProcessor.AddParameter("Color", e.ModifiedAppointment.Attributes["Color"]);

     

     

    this.SqlProcessor.AddParameter("DateStart", xStart.ToString("yyyy-MM-dd HH:mm"));

     

     

    this.SqlProcessor.AddParameter("DateEnd", xEnd.ToString("yyyy-MM-dd HH:mm"));

     

     

    this.SqlProcessor.Execute("stpUsersSchedule", CommandType.StoredProcedure);

     

    }

    Am I missing something

  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 05 Oct 2011 Link to this post

    Hello Michel,

    I could not quite understand what seems to be the problem so I am sending you a working demo project that shows how custom attributes are used. Make sure that the name of the attribute is the same like the name of the field in the database. 

    If you still experience the problem please try to explain it via the sent project.
     
    All the best, Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top