Playing around with the ProDatabinding Designer, I see stuff in the code that refers to a "tableDesc" thingy.
tableDesc1 = NEW Progress.Data.TableDesc("Menu")
and
arrayvar0[1] = NEW Progress.Data.ColumnPropDesc("MenuName", "Menu", Progress.Data.DataType:CHARACTER).
(Menu is a table that I created in the Designer, with MenuName as a field)
Now, is there any relation between this "thingy" and a temp-table ? How can I populate this ? Or is it a placeholder for a db / temp-table record ?
It's a place holder for the schema of a progress data source (temp-table, prodataset, db query).
The ProBindingSource will only know at runtime the schema of your data source. To enable the visual design including data binding properties, some schema representation is required. Also if you open a query very late (i.e. when the user presses a search button), but you want to see the grid column when the form is launched.
So, do I create the "placeholder" schema at design time, and then attach the "real" schema at runtime ? If this is the case, I presume that the temp-table name and fields must match the placeholder name and fields
Exactly. I would assume the datatype as well.
What happens, when you have a mismatch in those names is, that during runtime the binding source will offer fields to the visual controls that they don't expect.
The ultragrid will just display them - but they are unformatted as you had no chance to format them in the VD. Other controls like textboxes will perform unbound as the field they have been told to bind to does not exists.
Mike, this may be a little cheeky, but do you have some example code of how you attach the temp-table to the datasource after designing it in the builder ?
I need a step-up, it's early Sunday morning and the red wine last night did not help one little bit
Thanks ...
That's rather simple: The VD creates an instance named bindingSource1 and you just assign the handle property:
bindingSource1:HANDLE = TEMP-TABLE ttJulian:HANDLE .
Or use a query:
bindingSource1:HANDLE = QUERY q:HANDLE .
So simple, I missed it. Thanks very much!
okies, I came across an issue here, and want to know if it's a bug or not.
using your example,
bindingSource1:HANDLE = TEMP-TABLE ttJulian:HANDLE .
compiles ok, but gives me a run-time error
"System.Exceptin: invalid handle specified for the bindingsource's property"
however, if I change the code to
def dataset foo for ttjulian.
bindingSource1:HANDLE = dataset foo:HANDLE .
it all works ok.
Is this a bug, or not ?
Julian, this is not a bug. The bindingsource object can be bound to a dataset, query or buffer, but not a temp-table. I hope that helps.
sarah
Yeah, a few days later things make more sense.