Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Two calendars updating each other (Read 3816 times)
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Two calendars updating each other
Oct 4th, 2007 at 10:24am
Print Post  
Hi, I am new to this controland am making good progress using the trial version whilst my employer gets ready to buy the full product.

On my form I have a listview and two calendar controls, one in monthview and the other in timetable view.

When I click a date on monthview the timetable view jumps to that date, super Wink

When I add an entry through the keyboard on the timetable view the asscociated date on the monthview is set to yellow with red text, super;-)

If I type an entry on the timetable view I can not delete it, bums Sad

If I drag an entry from the listview onto the timetable view the cell is populated will all the listview rows data, super Wink

But the monthview date does not reflect a draged event onto the timetable view, bums Sad

I can double click on either the dragged entry or the typed entry and open the edit appointment form and delete the entry, super Wink

but the associated date is not updated to to reflect the removal, bums Wink

And then there is the problem if a timetable view date has multiple entries and some are deleted how does one ensure the monthview associated date is not cleared whilst there is an entry there?

Any pointers or tips or links to tuts will be most welcome...

Thanks







  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Two calendars updating each other
Reply #1 - Oct 4th, 2007 at 11:23am
Print Post  
Hi,

First, I would like to recommend you to take a look at the MDI, DualView and Sync samples, all of them installed with the control in the /Samples subdirectory. These samples illustrate techniques for solving problems very similar to those you are facing with just minor efforts. The samples also illustrate how to resolve the two 'update to reflect' problems you are having.

As for the item not being deleted in the Timetable view: are you trying to delete the item interactively or programmatically and what exactly are you doing in order to delete the item. In general, items should be deleted when they are selected and the user presses the Del key while the calendar has the input focus.

Meppy
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Two calendars updating each other
Reply #2 - Oct 4th, 2007 at 11:27am
Print Post  
HI, I will go through them again, but could not see in the demo samples what I am trying to acheive.

When I double click on an entry in the timetable view I use a version of one of the samples that opens an appointment form and this has a save and close button, recursive button and delete button on its toolbar.

It is this delete button that deletes the item from the timetable selected cell.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Two calendars updating each other
Reply #3 - Oct 4th, 2007 at 1:07pm
Print Post  
You said...

Quote:
If I type an entry on the timetable view I can not delete it, bums Sad

...and I thought you are having problems deleting the item from the timetable view, so I was wandering what were you doing in order to delete the item.

As a side note, are you using the same schedule in both views, that is, do both Calendar.Schedule properties refer to the same Schedule object?

Meppy
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Two calendars updating each other
Reply #4 - Oct 5th, 2007 at 5:29am
Print Post  
Hi,

well what I meant was if I typed an entry there was no way to delete it from the timetable until I had created the appointment form which included a delete button.

However I how created my own click event form which acts as I want but still the month view is not updated following a delete.

If I type an entry on the timetable it is updated onto the monthview by way of highlight and red text so that link is OK.

I have the timetable view named calendar1 and the mothview named calendar2.

I note that if I put a messagebox.show or break into the calendar1.itemmodified or calendar1.itemdeleted they do not trap ?


I also note that if I manually type in the timetable view the calendar1.itemcreated event fires:

Code
Select All
   Private Sub _schedule_ItemCreated(ByVal sender As Object, ByVal e As MindFusion.Scheduling.WinForms.ItemEventArgs) Handles Calendar1.ItemCreated
 



But if I do a drag and drop from the listview it does not even though the listview details appear in the timetable cell


« Last Edit: Oct 5th, 2007 at 6:40am by elpuerco »  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Two calendars updating each other
Reply #5 - Oct 5th, 2007 at 11:13am
Print Post  
Have you tried deleting the item by pressing the Del key while the item is selected?

As for the events they should fire only in response to interactive modifications. If you create, modify or delete an item through code (that is, programmatically), the events will not fire. Creating new items through drag and drop is also programmatic, thus the corresponding event is not raised.

A solution to this would be to create additional methods (for example, ProcessItemCreated and ProcessItemDeleted) and invoke these methods from both the ItemCreated/ItemDeleted event handler and from the code where you create/delete items programmatically. The new method will contain a single Item argument. In the first case you would pass the e.Item as an argument, in the second case you would pass a reference to the created/deleted item. The following code may give you an idea on how to do it:

Code
Select All
// This method is invoked always when a new item is created
// (either interactively or programmatically)
private void ProcessItemCreated(Item item)
{
    // Perform the necessary processing
}

// This is the ItemCreated event handler
private void OnItemCreated(object sender, ItemEventArgs e)
{
    ProcessItemCreated(e.Item);
}

...

// This is your code where you create items programatically.
// For example after the drag and drop is completed
Item item = new Appointment();
...
ProcessItemCreated(item); 


Meppy
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Two calendars updating each other
Reply #6 - Oct 7th, 2007 at 12:12pm
Print Post  
Thanks Meppy, result  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint