[Gambas-user] DataBrowser

Benoît Minisini gambas at ...1...
Tue Sep 1 02:07:31 CEST 2009


> No, Charlie,
> I didn't mean the headers. I know how to rename them.
>
> What I meant is:
> In my DataSource table I have a field "ProducerID".
> That points to another table "Producers" with the key field "id" and the
> field "Name". Now I would like to have the Column "Producers.Name" in the
> list instead of "ProducerID". I mean the field values of the records, not
> the headers.
>

In Gambas 3, the Table property of a DataSource can be any SQL request.

In Gambas 2, I'm afraid there is no simple solution. But try this: use your 
own DataView control, and create an Observer on the GridView of the DataView 
control - you get it with the DataView.GridView property. Then catch the Data 
event with the Observer: by using the Row property, you will know if you are 
in the ProducerID column, and then you can replace the displayed data with the 
name of the producer by setting the GridView.Data.Text property.

Regards,

-- 
Benoît




More information about the User mailing list