Matrin,
>Nice try :), but it's already .F.
It's the standard easy answer for most grid questions like this. *s*
>Col3 contain one container comming from a class.
>This container suppose to showing or not(visible=.T. or .F.) the field contain the child info.
>
>Ex:
>i just wanna see 1textbox in a container if this record just have 1 child.
>
>It's look like foxpro initialise the container only for the first record and show it for all. ?!?
This explaination helps tell what you are doing. It isn't going to be trivial, but should be workable. Basically though a table can only have one currently active row, especially where a grid is concerned. Sparse=.f. means that VFP leaves bitmap painted iamges of the non current row on the screen. And what you are trying to do is display multiple child records inside a single row. What I think you'll have to do is unbind the controls in the container and use code to simply set the this.Value = child.field in a scan loop that goes through the child records and turn the others .Visible = .f. if you don't have that many records. This is going to be kind of hard because I don't know of an event that fires as VFP goes through it's process of displaying each row of the grid. Turn on eventlogging and look to see if there is something you can hook to.
You might also just overlay a container for each row above the grid, you can use the Before/AfterRowChange and Scrolled methods to detect row changes and update the containers.
Maybe a grid in a grid would work, I think you'd have to create a view per column of the container.. but that leads to the idea of
why not just use a view in the first place? sorry it took so long to realize it, but hey it's my day off and I'm distracted by good Celtic music on Mountain Stage right now *s*The view columns would be:
Code, Description, childlabel1, childvalue1.. childlabel4, childvalue4
The code to fill in the necessary to conditionally fill the child columns in the view would be a lot simpler than the code needed to do what I talked about above.
>+----------+--------------+------------------------------------+
>| Code | Description | Child Data |
>+----------+--------------+------------------------------------+
>| A0001 | Name1 | label1 label2 label3 label4 |
>| | | Value1 Value1 Value1 Value1 |
>+----------+--------------+------------------------------------+
>| A0002 | Name2 | label1 |
>| | | Value1 |
>+----------+--------------+------------------------------------+
>| A0004 | Name4 | label1 label2 label3 |
>| | | Value1 Value1 Value1 |
>+----------+--------------+------------------------------------+
>| A0005 | Name5 | label1 label2 |
>| | | Value1 Value1 |
>+----------+--------------+------------------------------------+