Subject Re[2]: [IBO] A Correct way for browse and detail queries with IBO
Author Helen Borrie
At 12:37 PM 13/11/2003 +1000, you wrote:
>Hi Helen,
>
>thanks for direction and suggestions.
>
>HB> Well, first, for a selector list you wouldn't do a SELECT * query
>HB> normally. As a diehard pedant, I won't ever use select * except if maybe
>HB> I'm chucking a quick test app together.
>
>The selector query was the:
> >> SELECT BuyerCode, BuyerName
> >> FROM Buyers
>
>but yes, I agree.
>
>HB> Master-detail is ideal for this kind of 1:1 relationship if it's a big
>HB> table. If the BUYERS table is only small, say less than 200 rows all up,
>HB> you can use the same dataset for both the selector and the detail. Use a
>HB> single datasource and link both the selector grid and the detail controls
>HB> to it.
>
>hmmm, but if you wanted say 4 fields displayed in the selector list
>but 20 fields displayed in the detail record view, then don't you have
>to use two datasets as the displayed fields are dependant on the
>dataset and not the grid?

No. The fields are in the dataset and linked to the controls through the
datasource. You can display a single field in as many controls as you wish.

>As you pointed out:
>
>HB> In native IBO, the datasets drive the controls, so you set up all of the
>HB> grid properties in the dataset and the native grid has no Columns[]
>object.

Correct. Any fields from the dataset that you don't want displayed in the
ib_grid, just set their Visible field attribute to False. You can also set
other Grid things for the column, such as the caption, width, alignment and
so on.

ColumnAttributes settings do affect behaviour in all controls.

Helen