|
Rank: Newbie Groups: Member
Joined: 3/21/2009 Posts: 6
|
Why does the Datepicker NOT grey out when it is disable? How can I grey it out
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
How did you disable it? If you set the DatePicker's Enabled to False, it should disable both the textbox and the image button. The textbox will be grayed out, however the image button will NOT turn gray because it's an image. The DatePicker will display whatever image you give to it regardless it is enabled or not. This is the same behavior as a standard ASP.NET ImageButton control.
You can change the DatePicker's PopupImageUrl property to another image either manually or by code. Since the DatePicker displays whatever you give to it, you can set PopupImageUrl to a gray image at the same time when you set Enabled to false.
Regardless of the image, the button is disabled so user will not be able to click it.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/21/2009 Posts: 6
|
This is the code I used : Me.DatePicker1.Enabled = False The textbox is not is disable as well as the image. But, the textbox is not greyed out - Jerry
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Jerry,
Try put a Calendar in a new blank form and set its Enabled to False at design time. The textbox should be literally "grayed out" in FireFox, and disabled but may not be grayed out in IE. In both case the textbox should be disabled so you will not be able to type in anything; the image should also be disabled so you will not be able to click it.
If that works but when you set it with code it does not work, then it will almost certainly have to do with your code. Either your code is not called; or somewhere you enabled it again. There is no real difference between setting the property at design time or by code as far as from the Calendar's point of view since ASP.NET always generates code from .aspx and then run the code. So as the Calendar sees it, it's always set by code.
Thanks!
|
|