Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get bound data through a control?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00686363
Message ID:
00686368
Vues:
41
If I understand what you are asking for, I think the DataRow.DataRowVersion enumeration is what you are looking for. There is a constant called "Original" that contains the original value stored in a column. Check out the help in VS.NET at:

ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDataDataRowVersionClassTopic.htm



>Hello,
>
>I have a DateTimePickerEx class I'm trying to build which will filter out nulls in the database (DBNull) and display "No Date Picked" or similar, but it has to be able to view the original data which is being fed into the DataTimePicker class, from which it is derived. (DateTimePickerEx : DateTimePicker)
>
>Thus I need to get the data that it is bound to before it hits the base class. I cannot ask the base class for its value, because it alters it from what is in the datatable before setting its text property, and I cannot go straight to the datatable by name because it needs to be generic. (That is, I need to ask the DateTimePicker: "What is your datatable/view/etc." and then go to it based on the answer.)
>
>I've been successful in getting a string with the name of the dataset, with the following:
>this.BindingContext[this.DataBindings["Text"].DataSource.ToString()
>and
>this.DataBindings["Text"].BindingMemberInfo.BindingPath.ToString()
>(Where this is within the DateTimePickerEx derived class.)
>
>I can trap into the TextChanged event, and it will correctly fire whenever the datatable changes, now I just need to be able to read the *original* data so I can reset the format and customformat properties.
>
>Thank you,
>
>Zack Gainsforth
>ZackG@Rekon.com
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform