We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Restrict Day view

Thread ID:

Created:

Updated:

Platform:

Replies:

72360 Mar 15,2008 07:21 AM UTC Mar 17,2008 05:48 AM UTC WinForms 2
loading
Tags: ScheduleControl
Sumeda
Asked On March 15, 2008 07:21 AM UTC

Hi! All

I need to avoid showing day view when single day is click on schedule calendar. Is there anyway to achieve this ?

thanks in advance..


Anonymous
Replied On March 15, 2008 01:57 PM UTC

There is currently no event or property exposed that would allow you to get the described behavior.

But with a little work, you can probably do what you want. The Navigation calendar that you see on the ScheduleControl is actually an embedded panel (a NavigationCalendar object) that holds a grid (a GridControl object). To ignore that cell click that changes to the Day View, you can override the GridControl.OnCellClick. To get at this GridControl, you have to also derive the ScheduleControl and the NavigationCalendar as shown here.

public class MyScheduleControl : ScheduleControl
{
public override NavigationCalendar CreateNavigationCalendar()
{
return new MyNavigationCalendar();
}
}

public class MyNavigationCalendar : NavigationCalendar
{
public override GridControl CreateCalendarGrid()
{
return new MyCalendarGrid();
}
}

public class MyCalendarGrid : GridControl
{
protected override void OnCellClick(GridCellClickEventArgs e)
{
//ignore the click
//base.OnCellClick(e);
}
}


Here is a sample showing the click not changing into the day view.




CS_MDBsupportDerivedClasses.zip

Sumeda
Replied On March 17, 2008 05:48 AM UTC

Thank you very much again.

>There is currently no event or property exposed that would allow you to get the described behavior.

But with a little work, you can probably do what you want. The Navigation calendar that you see on the ScheduleControl is actually an embedded panel (a NavigationCalendar object) that holds a grid (a GridControl object). To ignore that cell click that changes to the Day View, you can override the GridControl.OnCellClick. To get at this GridControl, you have to also derive the ScheduleControl and the NavigationCalendar as shown here.

public class MyScheduleControl : ScheduleControl
{
public override NavigationCalendar CreateNavigationCalendar()
{
return new MyNavigationCalendar();
}
}

public class MyNavigationCalendar : NavigationCalendar
{
public override GridControl CreateCalendarGrid()
{
return new MyCalendarGrid();
}
}

public class MyCalendarGrid : GridControl
{
protected override void OnCellClick(GridCellClickEventArgs e)
{
//ignore the click
//base.OnCellClick(e);
}
}


Here is a sample showing the click not changing into the day view.




CS_MDBsupportDerivedClasses.zip


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;