Link to home
Start Free TrialLog in
Avatar of AbhiJeet
AbhiJeet

asked on

delphi6

i have a form, there is a combo box, date time picker, and a panel in the form.
In the panel two components are getting created at run time. One grid and one frame.
The frame contains one grid and the frame's parent is set to be the panel at runtime hence in my form i can see two grids at run time, say grid1(from frame) and grid2. Now grid1 is linked with grid2, hence when i scroll down grid2, the details are populated in grid1, meaning for one row selected in grid2, there could be multiple rows to be populated in grid1. Grid2 gets populated based on the date selected from the date time picker in the form and also the text of the text box.

Till this point everything looks perfect, now my problem starts with below implementation.
Now grid1 only gets populated when i click the row in grid2, but i need another screen where i need to show all details related to all the rows in grid2.
Hence in the form i shall need to take a check box eg, and when i tick the check box the new screen shall appear with all details related to grid2. when i unchek the tick box it should go back to my previous screen as it is.

I have designed another frame with a grid and trying to create multiple frames based on the rowcount of the grid2 and i am taking another scroolbox in the form, and setting these frames' parent as the scroolbox, so that when i shall tick the checkbox the scrollbox shall appear and when un-checked the panel shall appear.

How to implement this, please help with code.
Avatar of AbhiJeet
AbhiJeet

ASKER

any expert comment?
any solution?
Avatar of atul_parmar
If you are using data-aware grid e.g. TDBGrid then you should bind the another grid to the same dataset. If you are using stringgrid then you should use some data structure that is accessible to all related grids. e.g. you can maintain double dimensional array, or an array of record. or string list.
i need to know what should be the best design approach for this requirement and how to implement the same?
Use a data module; all your data should reside there. Those can be in the form of tables or other data structures. Then use a controller (a class) that creates data module and different views (i.e. screens/forms), and then establishes connections  to those different views and finally returns it to the caller.
i am not using any dbgrid, i am using stringgrids.
what version of delphi and what patch are you using ?
some versions have buggy TFrame implementations
ASKER CERTIFIED SOLUTION
Avatar of atul_parmar
atul_parmar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial