Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataColumn property
Message
From
12/12/2003 13:00:10
Gerald Caussade
Department Mental Health - Missouri
Farmington, Missouri, United States
 
 
To
11/12/2003 19:45:44
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00857952
Message ID:
00858671
Views:
29
I have a custom TextBox control that derives from TextBox. In it I have property for DataColumn and DataView. The DataView property works fine, but my property DataColumnp of type DataColumn for some reason says it is null, even if I set it during design time.

I can drop my custom TextBox control, called DMHControl on the form, then look at the property window, and select a column next to the DataColumnp property during design time. I can see a + sign show up after I select the column. I can expand it and see details for the column, but suspiciously, the name does not appear next to the property, but the + sign *does* show up, so it appears set.

The problem appears during execution. I have a DataBind method that I call when the form is created. In DataBind it accesses the DataColumnp (of type DataColumn as show in code fragment in my prior reply), but it throws a null exception. In the watch window I can tel that DataColumnp or for that matter my private variable _dc is null!

I'm stumped because I am no code that assigns anything to this property except for the public accessors (get and set)in the Property code. Again, I showed this code in my previous post.

I fear there is a bug and the column isn't actually set at design time, but I am at a loss on how to change the code to work, because I've been able to get any othe Property working as a component, by simply making it public and putting in the proper get and set code.

Thanks for your help!

-Jerry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform