I am developing an attendance system where the functioning of the system depends on date. For instance, if it is local holiday or sunday, the control of system like Create Leave features is to be disabled. Also, the calender must show red on holidays. Is there any control in asp.net that helps me do this efficiently.how to create custom calender and add event on that calender and make system function according to calender!!!
Asp.Net has a calendar control. Play with it.
Related
I am currently working on WP8 and my requirement is to create a item which allows user to select both Date and Time and the details are combined and added in TextBox.
Can anyone suggest is there any third party control using which I can add this control or I should just create Custom Control ?
I am aware of creating custom control but it becomes difficult when managing data.
I'm pretty new to XAML/C# and have a view that contains two textboxes. When the user clicks on the textbox, I want it to open up a basic calendar with either today's date or the date of the textbox. Once the date has been clicked, I want it to return that value.
I was going to create a new XAML view with a calendar control and then work it with variables, but before I did that I wanted to know if there is a better / more technically correct way.
Thank you.
If you are developing WPF application then just use DatePicker control and if you want to get time also then install Extended WPF Toolkit in that use the DateTimePicker Control...
Developing for Windows Phone or WinRT (Windows Store) apps use DatePicker Control.
I need to use the control System.Windows.Controls.Calendar to display the Hijri Dates and to display the Gregorian dates as well in the same window.
I have tried thread Culture, but the result was all of the calenders were changed, and the change was only on the header of the Calender Control, i.e. the dates written on the grid of numbers are still the same.
I have tried to use a custom user control, an open source project programmed by somebody, but I have found too many problems and these project were hard to customize, so I need to use the native controls, with the native way of dealing with controls..
According to MSDN the System.Windows.Controls.Calendar does only support the Gregorian calendar - so basically doing what you want is impossible using the built-in control...
You will need to build such a control yourself or buy some control pack with Hijri support...
For some information on dealing with Hijri dates in .NET see MSDN.
EDIT:
The only calendar controls supporting Hijri I could find are here and here and here.
The "bigger" vendors in the .NET control world (like Telerik, DevExpress...) do NOT support hijri... they all have some "issue tracking" saying that they will look into adding support but these issues are open for years without any progress so far :-(
I am using the .NET Compact Framework in VS 2005.
How can we disable specific dates in a DatePicker in C#? And how can we disable all Saturdays?
Thanks
There isn't any built-in method to do this.
You have a few options, such as:
Using the built-in date picker, and then display a prompt if the user selects a Saturday,
Build your own date picker control from scratch, though this would require a bit more work, or
Use HTML to power your interface - there are many great date picker controls available for HTML, such as the one found in jQuery UI.
There is no built in functionality for your requirement. What you would have to do is handling that in the date changed event.
I was wondering is it possible to disable selected dates in a DateTimePicker, so that user cannot select them. i know its possible in web forms but in windows forms im unable to do this.how can i achieve this.
The ease with which you can do this will depend on the dates you want to restrict. For instance, if you all you want to do is specify a range of valid dates to pick, then you can use the MinDate and MaxDate properties to set the bounds. If however, you want to cherry pick certain days within a range (for instance, no weekends), there is no built in method for doing this.
You could either find a third party control with this functionality, or you could try to hack it a bit by adding an event handler to the ValueChanged event, and forcing the current date time to the last value (which you'd have to cache) if they user picked something that was illegal according to your business logic... but this is a less than ideal way to do it.
Developer Express controls are usually very flexible and judging from this support article you can achieve what you want to do with their DateEdit control.
The control collection can be obtained from the following location: Over 60 Free Controls from DevExpress. (the free offer is no longer available)
Don't forget to read the EULA.