c1Schedule : stop in-line editing of Subject

Posted by: chris.moxon on 14 July 2021, 10:39 am EST

    • Post Options:
    • Link

    Posted 14 July 2021, 10:39 am EST

    Hi,

    Not sure if this is possible - but here goes … we add appointments to the schedule in code, but we do not use any of the standard properties ie. Subject, Location etc - all our data is saved in the Tag property and then we display the info in a format that we need via the format events. We therefore also do not use your standard edit form - because again that wouldn’t make any sense to our users - we intersect the beforeAppointmentShow event and display our own editor. All so far is ok …

    But what isn’t ok - is when the user single-clicks an appointment twice - the control currently shows the user the contents of the Subject property and allows them to edit the value - this is similar to what Outlook does - but based on what I’ve said above - this doesn’t make sense for us, as we don’t use the Subject property and thus the appointment text is made to disappear (in reality - it’s showing the blank subject) - so is there any way, we can stop this from happening ? i.e. stop this in-line editing, as it isn’t relevant to the way we use your control.

    Thanks,

    Chris.

  • Posted 14 July 2021, 11:34 am EST

    Hi Chris,

    we use this code to prevent the standard edit form (handles the “BeforeAppointmentShow” event)

    
        private void c1Schedule_BeforeAppointmentShow(object sender, CancelAppointmentEventArgs e)
        {
          e.Cancel = true;
    
          //Show your custom edit form here.
        }
    
    

    Hope this helps

    Wolfgang

  • Posted 14 July 2021, 12:02 pm EST

    Hi Wolfgang,

    Yes - we use that code as well, to stop the standard edit form - but it’s not that form that we are trying to stop in the above situation - it’s the in-line editing of the subject. So if you just single-click an appointment - nothing much happens; if you then single-click the same appointment - the cursor jumps to the beginning of the text in the subject property and allows the user to edit it - so in my case (because subject is blank) the user sees the cursor in front of a blank appointment - which is bad for two reasons - one it looks naff and two, the user might think that whatever they enter will be saved - but it won’t, because we don’t use (ie save/show) the subject property.

    Cheers,

    Chris.

  • Posted 14 July 2021, 12:11 pm EST

    Ah, sorry, I just see that we have another bit of code to work around this: The “EditOptions” enum has a value “AllowInplaceEdit”, which seems to cause the trouble.

    We replaced all editing with custom code, so we just needed dragging:

    
    this.c1Schedule.EditOptions = EditOptions.AllowDrag;
    
    

    Hope this fixes it for you now :wink:

    Wolfgang

  • Posted 14 July 2021, 12:39 pm EST

    Brilliant Wolfgang - thanks for your help !!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels