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. Image for the cookie policy date
close icon

Restrict Day view

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..


2 Replies

AN Anonymous 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


SU Sumeda 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


Loader.
Live Chat Icon For mobile
Up arrow icon