I'm developing database application in wp7,where i using datepicker to store the date value.when i was add a record,it works perfectly,but during updating time when I'm editing the record,the datepicker value never changes.it contains the same value,how to make it as changeable?
Related
I had a datepicker in which I am getting default system date during its Initialization.But I don't want default date.I need to get a Title(Select Date) similar to PikcerTitle in Xamarin.Forms. Anyone please help me to bring a solution for my problem.Thanks in advance.
You can add a label and datepicker instead of just datepicker and hide datepicker. Add a tap gesture to the label, on the tap focus the datepicker and bind the text of the label to the datepicker's date.
On page load add your desired text in the label.
I have a native Date Picker in a windows phone app.
Using the DateChanged event I can perform actions when the user submits.
DatePicker.DateChanged += (o, args) =>
{
var date = args.NewDate;
// Do something with it
}
The problem I am facing is the event is not triggered if the user submits the date picker without changing the date.
Default value is set to today's date which makes it impossible to select this date.
Does anyone know how I can allow the user the select this date and perform actions after ?
Thanks for your help :)
There is no particular way of getting an event fired when the date is not changed. As you said the date picker by default selects the current date, you can perform the action you want to if the user selects today's date in the OnNavigatedTo, Loaded, or DatePicker_Loaded event. A better way to do so is providing the DatePicker an invalid date something like 1Jan1947, this ways the user has to change the date else it'll be invalid. Also if you write the code you want on dateChanged event, it'll fire automatically as when the DatePicker is Loaded it sets the date from default to the current date.
What I would recommend
is to use a binding property to hold a value and then performing the
operations onPropertyChanged event of that property. This ways your
logic is independent of your datePicker and you could write events
for each time the dateTime property changes.
Do remember to bind the datePicker's date property to the DateTime
property in a TwoWay Mode and an UpdateSourceTrigger of
PropertyChanged. This ways when you change the property from code
behind the data would reflect in the datePicker and when you change
the value in the datePicker, the data would be reflected in the code
behind as well
I'm facing a problem that I can't understand. I'm using Kendo Grid with InCell edit and I have a DateTime field in my Model.
When the grid enters in edit mode, the calendar is shown, but the grid only saves the inputed value if I select the value from the calendar. If I input the field manually, the value is not saved and the cell is not marked has dirty.
If it helps, I'm using MVC with Razor sintax.
Tks in advance!
I've found a workaround in Kendo's forums:
By design, the DatePicker does not raise the change event when the value is set programmatically - it raises only if the date is modified by the end-user. In case you need to trigger the change event, you can use jQuery trigger().
For example:
var datePicker = $("#datepicker").data("kendoDatePicker");
datePicker.value("01/01/2001");
datePicker.trigger("change");
Reference:
http://www.kendoui.com/forums/ui/date-time-pickers/datepicker-change-event.aspx
So basically what I did was to force the change event manually.
I am using Silverlight + MVVM to host a form with some fields like drop down list, text boxes and date controls.
I have some validations on the textbox and date control which fire automatically when the control loses focus.
I wanted to know if there is a way to reset the validations based on the drop down list change (captured in View Model)?
How to render an existing jquery datePicker based upon new values upon ajax post? And how do I change the start date of display based upon a particular date in the ajax post
Fire a function, that generates the date picker, when the ajax response is ready.
jQuery date picker has option defaultDate, which You can also change, when rendering new version of date picker.