We are having some difficulty disabling the DatePicker control and setting a "grayed out" effect. Is this supported?
What we are trying to achieve is the ability to clear the date and show a "grayed out" appearance. Or just disable the datepicker and show the grayed out effect and prevent date selection in either case.
What is happening, is when the date is cleared out, and the DisableTextBox property is set to true, the position of the image button shifts to the left where the textbox was before disabling.
Disabling the DatePicker should prevent the user from selecting any date when disabled, but should still show the textbox ( with a date, or cleared ) when disabled.
Here is the oncheckchaged handler for the checkbox. There is another method that just clears all form values.
Thanks,
Code: C#
protected void ui_chk_AnaStatus_OnCheckedChanged(Object sender, EventArgs e)
{
if (ui_chk_AnaStatus.Checked)
{
DateStart.DisableTextBox = true;
DateEnd.DisableTextBox = true;
DateStart.Enabled = false;
DateEnd.Enabled = false;
Date_Set(); // set the date to current days date
DateEnd.CssClass = "Test";
DateStart.BackColor = System.Drawing.Color.Gray;
DateEnd.ForeColor = System.Drawing.Color.Gray;
}
else
{
DateStart.DisableTextBox = false;
DateEnd.DisableTextBox = false;
DateStart.Enabled = true;
DateEnd.Enabled = true;
}
}