Click here to Skip to main content
15,881,715 members
Home / Discussions / C#
   

C#

 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
Wendell.S23-Nov-09 7:27
Wendell.S23-Nov-09 7:27 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
dojohansen23-Nov-09 8:05
dojohansen23-Nov-09 8:05 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
Wendell.S23-Nov-09 8:56
Wendell.S23-Nov-09 8:56 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
dojohansen23-Nov-09 9:14
dojohansen23-Nov-09 9:14 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
Wendell.S23-Nov-09 17:11
Wendell.S23-Nov-09 17:11 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
Gerry Schmitz23-Nov-09 22:30
mveGerry Schmitz23-Nov-09 22:30 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
Wendell.S23-Nov-09 23:52
Wendell.S23-Nov-09 23:52 
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
dojohansen24-Nov-09 0:14
dojohansen24-Nov-09 0:14 
I still don't get it.

Can't your component just set the Total property, to which the TextBox is bound?

Why does it need to have another property and bind this to the Total property? To do so dynamically it would have to know about (discover) the Total property anyway, so rather than create another property that also represents the total, and then bind this to the "real" Total property, and then set this other property so that the read-write binding causes the Total property to change... would it not be a lot easier to simply assign the Total property directly?

It may very well be that I haven't understood what you're trying to do. But if all you want to do is to automatically load the data from a foreign key into another data source, I cannot see how bindable properties comes into the picture at all. You just need to know what the foreign key value is and to what table it refers, and you could hold this information in any number of simple data structures, regardless of how it is obtained (mapping files, dynamically discovering relations defined in the database, attributes on the entity types, or whatever).

I will simply repeat this: Writing a bunch or relational logic and putting into a user interface component is not a good idea. It is no less work yet has many drawbacks compared to properly separating UI from business logic from data access. The problem you are trying to address, that of having to spend a lot of time on mundane data access code that to a large extent follows automatically from the data model (in most cases, the entities in the domain model largely correspond to the tables in the database), is one that many large and well organized groups of people have tried to tackle before you. Take a look at the Entity Framework, or NHibernate, or even CodeSmith templates that will generate a DAL for you.
GeneralRe: Components: create runtime/designtime bindable property, possible? Pin
Gerry Schmitz24-Nov-09 4:07
mveGerry Schmitz24-Nov-09 4:07 
QuestionUngroup shape in word file in c# Pin
Pankaj Saha23-Nov-09 2:24
Pankaj Saha23-Nov-09 2:24 
AnswerRe: Ungroup shape in word file in c# Pin
Pankaj Saha23-Nov-09 3:42
Pankaj Saha23-Nov-09 3:42 
GeneralRe: Ungroup shape in word file in c# Pin
Abhishek Sur23-Nov-09 3:48
professionalAbhishek Sur23-Nov-09 3:48 
GeneralRe: Ungroup shape in word file in c# Pin
Pankaj Saha23-Nov-09 17:46
Pankaj Saha23-Nov-09 17:46 
QuestionGetting CurrentException without catch. Pin
Paulo Zemek23-Nov-09 1:48
mvaPaulo Zemek23-Nov-09 1:48 
AnswerRe: Getting CurrentException without catch. Pin
Richard MacCutchan23-Nov-09 2:06
mveRichard MacCutchan23-Nov-09 2:06 
AnswerRe: Getting CurrentException without catch. Pin
Luc Pattyn23-Nov-09 2:19
sitebuilderLuc Pattyn23-Nov-09 2:19 
AnswerRe: Getting CurrentException without catch. Pin
Shameel23-Nov-09 4:30
professionalShameel23-Nov-09 4:30 
GeneralRe: Getting CurrentException without catch. [modified] Pin
Paulo Zemek23-Nov-09 6:22
mvaPaulo Zemek23-Nov-09 6:22 
GeneralRe: Getting CurrentException without catch. Pin
The Man from U.N.C.L.E.23-Nov-09 6:52
The Man from U.N.C.L.E.23-Nov-09 6:52 
GeneralRe: Getting CurrentException without catch. Pin
Paulo Zemek23-Nov-09 7:03
mvaPaulo Zemek23-Nov-09 7:03 
GeneralRe: Getting CurrentException without catch. Pin
Shameel23-Nov-09 7:23
professionalShameel23-Nov-09 7:23 
AnswerRe: Getting CurrentException without catch. [modified] Pin
dojohansen23-Nov-09 8:25
dojohansen23-Nov-09 8:25 
AnswerRe: Getting CurrentException without catch: use Marshal.GetExceptionCode() Pin
Daniel Grunwald23-Nov-09 13:07
Daniel Grunwald23-Nov-09 13:07 
GeneralRe: Getting CurrentException without catch: use Marshal.GetExceptionCode() Pin
Paulo Zemek23-Nov-09 13:12
mvaPaulo Zemek23-Nov-09 13:12 
QuestionParameterless catch? Pin
Etienne_12323-Nov-09 0:20
Etienne_12323-Nov-09 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.