(Hopefully) Quick problem:
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScheduler ID="RS1" AllowEdit="false" |
| ShowHeader="false" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" ShowNavigationPane="false" |
| ShowViewTabs="false" SelectedView="WeekView" ShowFooter="false" ShowAllDayRow="false" |
| DataKeyField="ID" DataSubjectField="Subject" DataEndField="End" DataStartField="Start" |
| runat="server" WeekView-ColumnHeaderDateFormat="ddd" > |
| </telerik:RadScheduler> |
| </div> |
| </form> |
| public partial class Test : System.Web.UI.Page |
| { |
| public class ItemSchedule |
| { |
| public string Subject; |
| public DateTime Start; |
| public DateTime End; |
| public string ID; |
| public ItemSchedule(string subject, DateTime start, DateTime end) |
| { |
| Subject = subject; |
| Start = start; |
| End = end; |
| ID = Guid.NewGuid().ToString(); |
| } |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| List<ItemSchedule> items = new List<ItemSchedule>(); |
| items.Add(new ItemSchedule("test", DateTime.Now, DateTime.Now.AddHours(1))); |
| RS1.DataSource = items; |
| } |
| } |
Error says:
DataBinding: 'Test+ItemSchedule' does not contain a property with thename 'ID'.
I do have a public property with the name of ID in my class (despite it being supposedly optional according to http://www.telerik.com/help/aspnet-ajax/schedule_databinding.html) but I must be missing something...
If possible I'd like to not even have an ID, but otherwise...why doesn't this work?