datetimepicker

Why does setting a Winforms DateTimePicker to DateTime.MinValue fail?

人走茶凉 提交于 2019-12-05 02:38:09
I have the following code in my Winforms OnLoad event: dtpStartDateFilter.Value = DateTime.MinValue; dtpStartDateFilter is a standard WinForms date time picker. When my form loads it encounters the previously entered code line and then exits (with WinForms eating the exception so I have no idea what it is). What's wrong with doing this? DateTimePicker.MinimumDateTime > DateTime.MinValue DateTime.MnValue The value of this constant is equivalent to 00:00:00.0000000, January 1, 0001. DateTimePicker.MinimumDateTime The minimum date and time that can be selected in the control. The default is 1/1

How to get datetimepicker c# winform checked/unchecked event

余生长醉 提交于 2019-12-05 00:08:51
There is a check box in the datetimepicker control of winforms .net. But I could not find the event that is triggered when the check box is checked or unchecked . Is there a way out? You´ll have to store the old "checked" value in order to compare to the new one, so you´ll be able to determine if the "checked" state has changed: bool oldDateChecked = false; //if it's created as not checked private void dtp_filtro_date_ValueChanged(object sender, EventArgs e) { if (this.dtp_filtro_date.Checked != oldDateChecked) { oldDateChecked = this.dtp_filtro_date.Checked; //do your stuff ... } } It does

Custom Date Time picker using NumberPicker and FragmentDialog in android

喜欢而已 提交于 2019-12-04 21:26:56
I want to a custom Date Time Picker Dialog exactly as shown in the image. In my project this is dialog is shown when clicked on a TextView which is in a Fragment . I know that I need to use NumberPickers which populates the dates From Current date till all the dates next week. The default android date and time pickers doesnt fit my required so I need to create my own custom `DateTimePicker fragmentDialog'. My required DateTimePicker <LinearLayout android:background="@color/background_default_white" style="@style/LinearPageLayout" xmlns:android="http://schemas.android.com/apk/res/android">

SQL statement with datetimepicker

纵然是瞬间 提交于 2019-12-04 17:13:18
This should hopefully be a simple one. When using a date time picker in a windows form, I want an SQL statement to be carried out, like so: string sql = "SELECT * FROM Jobs WHERE JobDate = '" + dtpJobDate.Text + "'"; Unfortunately, this doesn't actually provide any results because the JobDate field is stored as a DateTime value. I'd like to be able to search for all records that are on this date, no matter what the time stored may be, any help? New query: SqlDataAdapter da2 = new SqlDataAdapter(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT * FROM Jobs WHERE JobDate >= @p

How do I set the language for datetimepicker?

梦想与她 提交于 2019-12-04 03:39:48
问题 Is there any property to set the language for datetimepicker? When displaying the calendar, that is - if I want the week days to be displayed in Spanish, for example... 回答1: You can't change the culture, which contains weekdays names among other things, on a single control like the DateTimePicker, but at thread level. 回答2: You can change culture for thread: System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("es-ES"); System.Threading.Thread.CurrentThread

Datetime filter in kendo grid

夙愿已清 提交于 2019-12-04 03:25:34
My code is in C# .NET I am using Kendo Grid version 2013.2.716.340 and server binding to show data in grid. In Kendo UI Grid, I have a dateTime column but the column filter input only has a date picker but no time picker. Due to this if I select the option IsEqualTo and give a date then I get zero results as the time is set to 00:00:00 in the filter but the columns have some time value. I want to add time picker along with date picker. I tried to do this on my column, but it didn't work: columns.Bound(o => o.Time).Title("Time").Format("{0:MM/dd/yyyy HH:mm:ss}").Filterable(f => f.UI(

Read data from sql database using datetime picker

不羁的心 提交于 2019-12-04 02:13:33
问题 How to read data from database using datetimepicker value. I have a datetimepicker and a datagridview in my form. I want to get data from Sql databse table with the selected datetimepicker value. I try with this code Private Sub BTNFIND_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNFIND.Click getConnect() Dim editdate As String DTPEDITAT.Value= Format(DTPEDITAT.Value, "dd/MM/yyyy") editdate = DTPEDITAT.Value MessageBox.Show(editdate) Try Conn.Open() Dim strSQL

DateTimePicker never updates!

假装没事ソ 提交于 2019-12-04 00:24:43
I have some DateTimePicker s in a form that never update. I've tried Value and Text , Invalidate() and then Update() and also Refresh() ... Nothing seems to change their values from the current date! No matter what I set, the current dates are (relatively)today's! Is this a .NET 3.5 bug or what? (No, I cannot use .NET 4 on this project.) If you really want some code, then here it is: dateTimePicker1.Value = user.BirthDay; . Also, if I write MessageBox.Show(user.BirthDay.ToString()); I get a nice box telling the user's birthday (my birthday, on my machine). (So there is a value in the variable.

DBGrid中插入DateTimePicker

被刻印的时光 ゝ 提交于 2019-12-04 00:16:48
DateTimePicker inside a DBGrid Here's how to place a TDateTimePicker into a DBGrid. Create visually more attractive user interfaces for editing date/time fields inside a DBGrid - place a drop down calendar into a cell of a DBGrid. procedure TForm1.DBGrid1DrawColumnCell (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if (gdFocused in State) then begin if (Column.Field.FieldName = 'DateAdded') then with DateTimePicker do begin Left := Rect.Left + DBGrid1.Left + 1; Top := Rect.Top + DBGrid1.Top + 1; Width := Rect.Right - Rect.Left + 2; Width :

Cannot get Jquery DateTimePicker to display in mvc4

核能气质少年 提交于 2019-12-03 21:47:56
here is my script <script type="text/javascript"> $(document).ready(function () { // alert("jquery working fine, still no display.."); $(".datepicker").datetimepicker({ showAnim: 'slideDown', dateFormat: 'dd/mm/yyyy' }); }); </script> <input type="text" class="datepicker" /> The actual Datepicker works great, firebug shows this script, the jqueryUI, the timepicker-addon.js, slider.js, and datepicker.js, jquery is selecting the textboxes. but alas, still no datetimepicker displaying I've tried using id's/classes, rearranging the order the scripts are loaded. I would say that the addon is just