I am trying to get my app to verify and save the data that a user simply types into the schedule.
I have found that after the user presses the Enter key the calTimeTableView.ItemInplaceEdited event is fired.
So I put this code in this event:
' update calendar tables in database
Me.calTimeTableView.SaveToDataSource(Me.ReminderTableAdapter1, Me.StyleTableAdapter1, Me.CustomBrushesTableAdapter1, Me.ContactTableAdapter1, Me.LocationTableAdapter1, Me.ResourceTableAdapter1, Me.TaskTableAdapter1, Me.ItemTableAdapter1, Me.ItemContactsTableAdapter1, Me.ItemResourcesTableAdapter1, Me.RecurrenceTableAdapter1, Me.RecurrenceExceptionTableAdapter1, Me.RecurrenceExceptionsTableAdapter1)
' force calendar to redraw
calTimeTableView.Invalidate()
but I get an INdexOutOfRange error:
Index -1 is either negative or above rows count.
However the data gets saved to my Item and Style tables, which are the only ones in use at present.
If I include this:
Me.calTimeTableView.Schedule.Items.Add(e.Item)
I get an error stating the item already exists in the schedule.....I understand that error but not the index out of range?
Help please anyone....