0

I'm trying to implement a functionality using TcxGrid in Delphi RAD STUDIO:

I have 2 tables, CARS BRANDS and MODELS, I want to show all the Car Brands and Models (on the grid), and let the user pick any Cars brands (BMW, Mercedez, Ferrari) (previouslly created on the CAR BRANDS table) and then pick any of the Models for each brand. For instance, User picks BMW and decides to pick for that brand the models 1A, 2B, 3C (previouslly created on the MODELS table). Then, picks Ferrari and the models 1A, 3C, 4D for that brand. Finally he clicks "SAVE" and it will create a third table: CAR BRANDS/MODELS with the information:

(BMW, 1A);(BMW,2B);(BMW,3C);(FERRARI,1A);(FERRARI, 3C);(FERRARI, 4D)

I'm looking for some way to implement this, thank you in advice!

BaldwinIV
  • 147
  • 10

1 Answers1

1

Your wish come true by simple approach. You need use usual master/detail grids. In the top of your form you need to place master grid with data from table CAR BRANDS, and in the bottom part of your form you need place the secong grid(detail) with data from MODELS.

In detail grid you need make one field with checkbox for selecting models.

These two forms will be works by following way: when user clicks on row in master grid, then you must update detail grid and show for user all models for selected car brand.

If you use devexpress you can find interesting examples in demo for VCL.

Anton Tokmakov
  • 689
  • 4
  • 14