Hello,
I am looking for a way to remove all of the appointments from my UltraCalendarInfo object. I have tried using .appointments.clear(), but got an error saying "System.IndexOutOfRangeException: 'Index 0 is either negative or above rows count.'" I've tried a few other things as well, but ran into a variety of problems for those too. Any suggestions are appreciated. Thanks.
In order to understand the nature of the issue i set up a test sample against V21.2 and on button click i am clearing the appointment using the same code yo mentioned ultraCalendarInfo1.Appointments.Clear();
its working fine for me .
Here i attached my sample application for you to test. if this is the correct demonstration of your issue then feel free to modify the sample and send me back for further investigation.
Regards,6237.Sample.zip
Hmm. You're right, I can't seem to recreate this issue outside of my project either. Nevertheless, it is still occurring inside the project, so I will need to deal with it. Do you have any ideas about what could be causing an error like that? Maybe there is some property of the appointment object that the clear method is reliant on that I forget to set when adding my appointments or something?
Thank you for the update. I am not sure what could be causing this issue in your project until i debug your code and test. If possible please share your isolated sample or try to isolate it at your end.
Looking into API i find we have a method 'RemoveAllAppointmentsForOwner' which removes all of the appointments that were assigned to the owner, check if this can help, instead of using clear method.
https://www.infragistics.com/help/winforms/infragistics.win.ultrawinschedule~infragistics.win.ultrawinschedule.appointmentscollection~removeallappointmentsforowner
Let me know if you have any question.
That method worked for me. No idea why the other one wouldn't. Luckily I haven't used any owners in my application, so It was just a simple one line call. Thanks for your help! :)