After put inside this code
- // don't convert it to datetime (as you said, it may be null)
- var stringValue = (prijava_radnikaDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn3"].Value);
- var dateValue = string.IsNullOrEmpty(Convert.ToString(stringValue)) ? DateTime.MinValue : Convert.ToDateTime("2018-01-01 00:00:00");
- // now, datevalue is the new value for datepicker
- if (string.IsNullOrEmpty(Convert.ToString(stringValue))) vrijemeodjaveDateTimePicker.Value = dateValue;
I have error
- Activated Event Time Duration Thread
- Exception thrown: 'System.ArgumentOutOfRangeException' in System.Windows.Forms.dll ("Value of '1.1.0001. 00:00:00' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.") 14.33s [17640]

Nitin SontakkeRank #264 · 9.6K reputationPosted Mar 24, 2018, 6:51 PM EDT
Goran BibicRank #993 · 2K reputationPosted Mar 24, 2018, 10:44 PM EDT
Ruchi SharavatRank #1,714 · 885 reputationPosted Mar 26, 2018, 11:03 PM EDT
Goran BibicRank #993 · 2K reputationPosted Mar 26, 2018, 11:05 PM EDT