BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Query |
Solution |
I linked a button to a new Form. As I don't want the uer to be able to change the events from the schedule, I canceled the event showing the appointment form. But when I close the form I still have the messageBox asking if I want to discard changes. How can I disable this messageBox ? |
In order to avoid the MessageBox showing when closing the form. SaveOnCloseBehaviorAction property can be used. Please refer to the below code example,
Code example
this.scheduleControl1.DataSource.SaveOnCloseBehaviorAction = SaveOnCloseBehavior.SaveWithoutPrompt; |
I'd like also to display week-end in the WorkWeek view, is this possible ? |
In order to display the week end in WorkWeek view, you can use the CustomWeek schedule view and SelectedDates property can be used to add the dates in ScheduleControl. Please refer to the below code example and the sample,
Code example
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.Clear();
this.GetWeekDays();
private void GetWeekDays()
{
int count = 7;//No of days in week.
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.BeginUpdate();
DateTime theDate = this.scheduleControl1.GetScheduleHost().Calendar.DateValue;
while (theDate.DayOfWeek != this.scheduleControl1.Appearance.NavigationCalendarStartDayOfWeek)
{
theDate = theDate.AddDays(-1);
}
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.Clear();
while (count > 0)
{
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.Add(theDate);
theDate = theDate.AddDays(1);
count--;
}
this.scheduleControl1.GetScheduleHost().Calendar.SelectedDates.EndUpdate();
}
Note
If you want to navigate the weeks using caption panel arrow. Please use the below code,
Code example
foreach (Control con in this.scheduleControl1.CaptionPanel.Controls)
{
if (con is ThemedScrollButton)
{
ThemedScrollButton button = con as ThemedScrollButton;
button.Click += button_Click;
}
}
void button_Click(object sender, EventArgs e)
{
ThemedScrollButton button = sender as ThemedScrollButton;
if (button.Text == "<")//Move to previous week
{
this.MoveInDirection(false);
}
else if (button.Text == ">") //Move to week forward
{
this.MoveInDirection(true);
}
}
|