This example illustrates how you can modify the behavior of the Date Navigator control by creating a class descendant and overriding the required properties. The DateNavigator descendant allows selecting more than seven dates by days, not by weeks, which is the default behavior.
View Example
public class MyDateNavigator : DateNavigator
{
protected override DateTime AdjustSelectionEnd(DateTime start, DateTime end)
{
return end;
//return base.AdjustSelectionEnd(start, end);
}
protected override DateTime AdjustSelectionStart(DateTime start, DateTime end)
{
return start;
//return base.AdjustSelectionStart(start, end);
}
}
Public Class MyDateNavigator
Inherits DateNavigator
Protected Overrides Function AdjustSelectionEnd(ByVal start As Date, ByVal [end] As Date) As Date
Return [end]
'return base.AdjustSelectionEnd(start, end);
End Function
Protected Overrides Function AdjustSelectionStart(ByVal start As Date, ByVal [end] As Date) As Date
Return start
'return base.AdjustSelectionStart(start, end);
End Function
End Class