Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataColumn property
Message
De
12/12/2003 18:25:15
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
12/12/2003 13:00:10
Gerald Caussade
Department Mental Health - Missouri
Farmington, Missouri, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00857952
Message ID:
00858827
Vues:
29
Jerry,

I think that perhaps you are confusing the property returning a null value (of type DataColumn), and the property losing its assignment. If the data contained in the object that the property is bound to is null, evaluating the property should return (DataColumn)null.

>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform