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

Question about Custom Attributes

4 Answers 120 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Shane Ham
Top achievements
Rank 1
Shane Ham asked on 05 Jun 2009, 02:12 PM
I have a custom InlineInsertTemplate and a custom InlineEditTemplate that I am trying to use custom attributes with.

I have 2 additional fields that I am trying to include in the Appointment declared in code behind as
RadScheduler1.CustomAttributeNames = new string[] {"factorName", "Notes"};

These are Binded in the custom templates using the following syntax

<

 

asp:TextBox ID="EditTxtNotes" runat="server" TextMode="MultiLine" Rows="5" Width="100%" Text='<%# Bind("Notes") %>'></asp:TextBox>

 


Now I am trying to save the appointment by handling the AppointmentCommand event use the following syntax.

newProjection.Notes = e.Container.Appointment.Attributes[

"Notes"];

The attribute always returns an empty string. In fact the Attributes.Count of the Appointment is 0.

What am I doing incorrectly?

 

4 Answers, 1 is accepted

Sort by
0
Shane Ham
Top achievements
Rank 1
answered on 05 Jun 2009, 03:24 PM
Seems like the attribute collection is not available duing the AppointmentCommand event.
Using the AppointmentInsert event solves the issue.
0
towpse
Top achievements
Rank 2
answered on 02 Dec 2009, 08:13 PM
I'm trying to bind custom attributes as well. Currently trying to get my head around it.
I want to bind a combo box. It seems that you can only bind the text of a control.

What are you binding to your scheduler that has the Notes property?
Is it a telerik appointment object with a Custom Attribute called Notes? a data table with a Notes column?

It looks to me that the stuff in here
           <AdvancedEditTemplate> 
                <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" 
                    Subject='<%# Bind("Subject") %>' 
                    Description='<%# Bind("Description") %>' 
                    Start='<%# Bind("Start") %>' 
                    End='<%# Bind("End") %>' 
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' 
                    AppointmentColor='<%# Bind("AppointmentColor") %>' 
                    UserID='<%# Bind("User") %>' 
                    RoomID='<%# Bind("Room") %>' /> 
            </AdvancedEditTemplate> 

Can only be properties of the Telerik Appointment object.
0
Peter
Telerik team
answered on 04 Dec 2009, 01:53 PM
Hello towps,

Please, review this demo:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx

Track how the AppointmentColor custom attribute is used for two-way binding of the RadColorPicker in the custom advanced form.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Amit Vaidya
Top achievements
Rank 1
answered on 07 Jan 2010, 08:17 AM

Hi,

I want to change week view column header to links so that when user clicks on the link it will navigate to that particular day. How can I achieve this functionality.

Tags
Scheduler
Asked by
Shane Ham
Top achievements
Rank 1
Answers by
Shane Ham
Top achievements
Rank 1
towpse
Top achievements
Rank 2
Peter
Telerik team
Amit Vaidya
Top achievements
Rank 1
Share this question
or