With regards to the CustomTemplate Blog
that was posted yesterday I was wondering if it is possible to manage conditional conditions.
I have a generic data entry window where the user needs to enter different types of data but into the same businessObject property. The business object then handles the logic of assigning it to a number, date, string, etc. The binding property DataValue is of type Object.
In previous implementations (PowerBuilder) I basically had a grid but where I wanted to capture my data I had a dateField, a textField, a numberField and I stacked them on top of each other and then did a hide/show to let the user use the appropriate control.
My ultimate goal is to provide a rich set of input controls depending on the data type and the column type. So date would have a calendar, number could be a masked input, a checkbox, a dropdown list of values, a radio button set, a spinner control etc.
I also need to show a bunch of icons that indicate status, validity, etc. All these are bindable properties of my BusinessObject.
My original plan was to create a base usercontrol and then inherit from it for each input type I needed. Then I would create a giant stackpanel and add the user controls to it. That simulates my one data value per row concept.
When I saw the blog posting I thought maybe I could do it in a grid. The grid would obviously give me all the extra grid benefits (filtering is the key one) for free.
So is there a recommended solution for this type of implementation? Do I go ahead with my user controls and then is there a way to put them into the template column and somehow pass all the data binding through to the control?
or can I do something in the template columns based on the conditions of my dataType/FieldType
if dataType = 'Number' then 'bind to dropdown list'
if dataType = 'date' then 'bind to calendar'