I have infragistics XamDateTimeInput control. I want to prevent users to select some configured dates or past dates(Disable the dates). Here is the example which i found in a train booking site. They disabled the past dates.
Thanks.
I don't have the Infragistics control to test this, but from studying the XamDateTimeInput doc and the ValueConstraint doc, you should be able to set a min and max date by:
<XamDateTimeInput ...>
<XamDateTimeInput.ValueConstraint>
<ValueConstraint MinInclusive="Your min date" MaxInclusive="Your max date"/>
</XamDateTimeInput.ValueConstraint>
</XamDateTimeInput>
I can't find a way to block a specific date range though. However, a few weeks ago I stumbled across this article on CodeProject, where the author has modified a regular WPF DatePicker. His solution also includes support for Blackout Dates:
CodeProject: A couple of tricks when using the standard WPF .NET 4.0 DatePicker control
You may use this post to modify your Infragistics XamDateTimeInput control. I can't test or provide an example here, as like I said, I haven't purchased their controls.
Related
I have a requirement for a 4.2.1 ExtJS app that Im building, to have a grid like the image below:
The objective of the grid is to manage Holidays for employees.
I was thinking in setting the columns of the grid dinamically, but will need to fill the background cell depending of the type of "leave type", and also disable some cells depending on the days that are not supposed to work (like weekends, etc).
Any advice on how can I approach to the solution? Appreciate in advance.
There is a commercial scheduler that does exactly that and more. See http://bryntum.com
I have set two different cultures to the thread as:
Thread.CurrentThread.CurrentCulture = "fi-FI"
Thread.CurrentThread.CurrentUICulture = "en-Us"
But the calender text is shown in Finnish culture.
I need to keep the Text(Translations) based on CurrentUICulture and Text Format based on CurrentCulture.
Can you please suggest how can it be done for it?
That is not possible. The Calendar control only reacts to the CurrentCulture value. CurrentUICulture is used by the ResourceManager to load up different strings, images etc. used in the UI, but that is not where the day/month names are stored. They are part of the .NET framework itself. To get the functionality you want you will have to write your own implementation of the DatePicker and/or TimePicker controls. Perhaps you could download the code for the Silverlight Toolkit and use that as a base for your own implementation. What you are looking for is basically a way of overriding the names of months and days manually. Maybe it is even possible to extend the controls and add that functionality on top, but I doubt it.
Greetings,
Currently I am in process of developing an application for booking (etc. rooms). The most painful thing in front of me: "The booking chart". It should looks similarly to the following thing:
http://img195.imageshack.us/img195/4807/99573694.gif
Any suggestion how can I build the "skeleton" of the booking chart? should i use grid etc? I would like to navigate through the days and additionally passed number of items and current datetime range
Looking at your example it looks like a job for DataGrid (http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117 if you're on WPF 3.5, it's part of WPF 4).
I would implement the navigation functionality by using LINQ to filter your data set to the range you're interested in. The navigation controls would have to be provided by you separate from the DataGrid.
Hope that helps...
This looks similar to the Scheduling tool Billy Hollis shows in dnr tv number 115 which is a listbox on its side.
http://www.dnrtv.com/default.aspx?showNum=115
Mike
I'm getting some very strange date formatting issues in my Silverlight application. My local culture is set to UK, yet I am consistently seeing US dates popping up all over the place. I can easily hardcode these to UK format in specific loactions using:
<UserControl ... Language="en-GB"...>
But as I'm sure you'd all agree this is a terrible thing to do.
I have tried setting the Lanaguage to en-GB in the main application and this has partial success. I have also tried Justin Angels suggestion (posted here: How to change date format in Silverlight DatePicker control?), again only partial success.
An example of the issue can be seen here:
http://lh3.ggpht.com/%5FL9TmtwXFtew/Sw5aVZJfG1I/AAAAAAAAGkI/6jYnsB91HjI/image%5Fthumb%5B1%5D.png http://lh3.ggpht.com/%5FL9TmtwXFtew/Sw5aVZJfG1I/AAAAAAAAGkI/6jYnsB91HjI/image%5Fthumb%5B1%5D.png
The datagrid on the parent page shows UK formatting, whilst the information in the ChildWindow shows US formatting ...grrrr
Anyone have a definitive solution for solving this across a whole application?
Thanks,
Mark
You can data bind Language property of the root visual element. Take a look at my question here:
How to switch UI Culture of data binding on the fly in Silverlight
Can you not use the SelectedDateFormat property of the datepicker? If you want to do this once could you not create your own usercontrol that derives from the original with this value preset, then use your derived control throughout your app?
Kindness,
Dan
Shot in the dark, but does changing the browser's Language Preference make a differnence? I.e. in IE Tools-->Internet Options-->Languages.
HTH
Mark
You can set the date format for your entire application in the application start up event as follows.This will override any regional settings on the users machine
Thread.CurrentThread.CurrentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = dd/MM/yyyy";
I am searching for a DateTimePicker control which can be used as a textbox so user can enter date/time data at will (ie; type in the string "11/09/2008 12:30:00") or can select date/time from a drop down list that contains a calendar/time box (what i meant is that this control can provide both options as mentioned). If you have found such a flexible control (and free too) please give me the needed information to obtain it.
There's the DatePicker and Calendar controls from the WPF team, but I don't believe they handle times (as in your example) - just dates. Worth a look though.
Have a look at this WPF Date Picker question.
Cheers
Telerik has a decent DateTimePicker control but it's not free.
Old question, but for anyone interested... Extended WPF Toolkit™ Community Edition is free (also has a premium option) and contains a DateTimePicker which I have found to be very useful in WPF!
I am not sure whether you don't want to use JQuery or not aware of it. But here is this free/open source date time picker from JQuery which does exactly what you are looking for, plus lot more.