Posts

Showing posts from November, 2012

Hidden paths of MVVM - Lookup values

To recap, I am getting my feet wet in MVVM using XAML and I got stuck with a seemingly simple task. I have a field with domain values and I needed to display the description stored in another table. Ordinarily, I would have defined a calculated field in the target dataset and make it a lookup field against the dataset containing the description using the domain value as the matching key. I am using a strongly typed dataset for my data layer and conversant with using EXPRESSION property to derive values. My intial thought was to use the "RowChanging" event handler to populate the description for the domain value but then I thought that was not an efficient way to go and I suspected there was a way to actually implement some form of "lookup" even if it was not implemented in the traditional way. Well, I did a couple of googling and came across the concept of "RELATIONS" in dataset. Basically, Dot Net Framework allows relationship to be defined at desig...

Hidden paths of MVVM - Calc Field and Dynamic Value

I will save you the theatrics and plunge straight into the issue at hand. I am getting my feet wet with MVVM methodology using XAML and I had a situation where I needed to have a calc field assigned to computed dynamic value. My data layer consisted of a strongly typed dataset. After googling a couple of times, i found out there is a property called EXPRESSION that you can actually use with calc fields to derive values but it has a finite set of notations that you can specify at design time. Specifically, design time specification is only good for STATIC or known finite set of values. A lot of articles out there suggest using the "Column Change" and/or "Column Changed" events to assign complex values to a calc field. For whatever reason, I could not get the calc field populated using either of these events. I actually suspect the reason why the handlers for the events were not firing was becuase of the fact that I was doing a "READ ONLY" ( search) oper...