Карта сайта Интеллектуальная поисковая системаДобавить свою ссылку по ключевому запросуПоисковая система v3.kz поможет ускорить индексацию вашего сайта выводит в Топ |
|
possible duplicate of DateTimePicker Null Value (.NET) – bluish Nov 13 13 at 8:38. Nullable datetime column in .NET DataGrid with DateTimePicker. Re: DateTimePicker и значение NULL [new]. vagner Member. Откуда: Сообщений: 1713. При одной лицензии Вы разрабатывать можете только на одной машине, а программку свою можете распространять хоть по всему миру. By default DateTime is not nullable because it is a Value Type, using the nullable operator introduced in C# 2, you can achieve this. …but this throws an exception – since the DateTimePicker.Value property can’t be null. The DateTimePicker control shipped with .NET has a very nice look and feel but lacks one important functionality: You cant enter null values. That means that, if you bind your DateTimePicker control to a dataset, you run into trouble. Because in a database its normal to have nullable DateTime values. Re: NULL DateTimePicker. The point that I was trying to make was that you cant have a DateTime that is nothing, there is no such thing. It is cast as a DateTime? which allows you a little bit more flexibility. We start the nullable calendar with inheriting from the DateTimePicker native control, and Handle the CheckedChanged event to make the datetimepicker visible/invisible... And add a property Value of type Nullable<DateTime> that returns the datetimepicker.Value when the checkbox is not checked.. and null otherwise... But Value prop of the DateTimePicker is of the DateTime type, and it is value type. It means that it cant have null value. If you want to value types have null value it must be declared with System.Nullable<[type]> class. Информация взята v3.kz |
загрузка...
|