Hi,
It is difficult to disable the sunday, instead of we can restrict the user not to select the sunday.
DateTime lastDate;
System.Text.RegularExpressions.Regex rg;
bool valueChangingProgramatically = false;
public Form1()
{
InitializeComponent();
lastDate = dateTimePicker1.Value;
rg = new System.Text.RegularExpressions.Regex("Sunday");
if (lastDate < dateTimePicker1.Value)
dateTimePicker1.Value = dateTimePicker1.Value.AddDays(1);
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
if (!valueChangingProgramatically)
{
if (rg.IsMatch(dateTimePicker1.Value.ToLongDateString()))
{
valueChangingProgramatically = true;
dateTimePicker1.Value = lastDate;
}
}
else
valueChangingProgramatically = false;
lastDate = dateTimePicker1.Value;
}
You can also use other custom control, please refer the below link
http://www.devexpress.com/Support/Center/p/Q148134.aspx
Best Regards
Muthuraja