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
280
Load an Appointment from Datakey
posted

Hi all

I'm woking with daycalendar and for each created appointment I save all information (included the DataKey) to the database

I also list all appointments read from the DB into an UltraWinGrid and I would like to be able to load an appointment by doubleclicking  on the Ultragrid (using the datakey and not by clicking on the appointment itself), but I'm not able to do this

More in detail:

1) I create and empty appointment:

Dim Appointment As Infragistics.Win.UltraWinSchedule.Appointment

2) I try to fill the Appointment by a real one got from the Calendar info, thru the DataKey (ID)

Appointment = CalendarInfo.SelectedAppointments.GetItem(ID)

What I'm doing wrong?

How can i search by an existing appointment in the calendar using the Datakey?

Thanks for your help

Alberto

  • 18044
    Suggested Answer
    Offline posted

    Hello Alberto,

    Thank you for posting in our forums!

    The GetItem() method is inherited from Infragistics.Shared.DisposableObjectCollectionBase and is just an indexer; it does not accept a DataKey and could lead to some OutOfRangeExceptions the way you are trying to use it.

    We noticed you are also accessing the SelectedAppointments collection which will only return selected appointments.  What we recommend is to loop through the CalendarInfo.Appointments collection and compare each item's DataKey as needed.

    Let me know if I may be of further assistance.

  • 280
    Offline posted

    Hi Michael

    it works fine, even if if can be slow in case of several appointments. Thanks!!

    I'd suggest, for the future, to have the possibility to make a direct reference thru the DataKey

    Best regards

    Alberto

  • 18044
    Offline posted in reply to Alberto Ghiglia

    Hi Alberto,

    You can suggest new product ideas for future versions (or vote for existing ones) at <https://www.infragistics.com/community/ideas>.

    Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.

    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it.   You can also link back to this thread for additional details.

    Thank you in advance to submitting your product idea.