Groups | Blog | Home
all groups > dotnet windows forms databinding > march 2005 >

dotnet windows forms databinding : Databinding with CustomControl


Claudio Grazioli
3/21/2005 3:57:54 PM
Hi

I have a NullableDateTimePicker control inherited from DateTimePicker
control (windows forms). The NDTP has a property SmartDate of the type
SmartDate (SmartDate is a class enhancing DateTime with a Nullable
functionality).

I have a business object name Project with several properties, one property
(EndDate) is of type SmartDate. I want to bind this property to the
SmartDate property of a NDTP.

When I run my program, as soon as I show the form with the NDTP data binded
to the Project class, I get the following exception:

-----------
An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.windows.forms.dll

Additional information: Error creating window handle.
-----------

Any ideas? I do the data binding the same way as with normal controls like
textboxes, where it works without any problems.

thanx in advance.
--
Claudio Grazioli
Claudio Grazioli
3/22/2005 8:51:24 AM
[quoted text, click to view]

Alexander,

[quoted text, click to view]

I tried that, didn't change anything. I still get the same exception.

[quoted text, click to view]

Yes. That's the SmartDate from CSLA. I just took your Nullable Date Time
Picker and changed it to work with the SmartDate class. It seems to work
fine just the data binding problem.

--
Claudio Grazioli
Alexander Shirshov
3/22/2005 10:53:40 AM
Claudio,

Most likely an exception has been thrown in the constructor. Set the VS
debugger to catch all CLR exceptions and maybe you'll see something.

What's this SmartDate class? Is it from CSLA.NET?

Alexander

[quoted text, click to view]

Claudio Grazioli
4/19/2005 12:00:00 AM
[quoted text, click to view]

I finally solved the problem. I wrote articles explaining the problem and
specially the solution. You find them here:

Nullable DateTimePicker:
http://www.codeproject.com/cs/miscctrl/NullableDateTimePicker.asp

Nullable DateTimePicker for CSLA.NET:
http://www.grazioli.ch/Blog/#a38737e9a-250b-4fe1-b806-0c31de3c0b19

--
Claudio Grazioli
http://www.grazioli.ch
AddThis Social Bookmark Button