Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
New Class Inherited from Appointment - Customising Appointment
posted

Hi Andrew,

 

I have created my own class “MyClass” and inherited it from Appointment Class.

 

The Created objects of them and assigned it to the Appointment collection.

 After retemplated the igSchedulePrim:ActivityContentPanel, i was able to display my new properties.

So far so good.

But now once I start to add new appointments it gives me following error Stating

The value "Infragistics.Controls.Schedules.Appointment" is not of type "ScheduleSample.MyActivity" and cannot be used in this generic collection.

Parameter name: value

I am I doing anything incorrect?

 

Regard

Saurabh Dighade

Parents Reply
  • 54937
    Offline posted in reply to Saurabh

    saurabhd13 said:

    You wouldn't assign the DataItem. The ListScheduleDataConnector AppointmentItemsSource would be bound to your collection of ScheduleSlot instances. It would create an Appointment to represent each item and it would associate the Appointment instance with your ScheduleSlot instance.

    saurabhd13 said:
    Now If I have to use my “Custom Properties” in say myStringActivityName” or “MyNumberContract ” for display and edit what should I do?

    You would use the MetadataPropertyMappings of the AppointmentPropertyMappings and add a MetadataPropertyMapping for each custom property you have where the MetadataProperty of that mapping would be set to the name of your custom property on your data item.

    saurabhd13 said:
    I also need to use them in Data binding when I re-template my activity template.

    To access the property you would use WPF/SL's support for indexed properties and so in your binding the path would be something like "Metadata[MyNumberContract]"

Children
No Data