Panel, PanelLink, View
These grid properties hearken back to the days when people actually used split Browses for data entry. In the never-ending quest for backward compatibility, grids offer the same set of options for side-by-side panels, with each panel able to use either the one-row-per-record Browse mode or the one-row-per-field Edit/Change mode. It's far easier to set this stuff up in Visual FoxPro than it ever was before, though we don't see ourselves using it any more than we did—other than for the rare quick-and-dirty dBASE III data-entry situation. Although there are times where a split grid would be handy, given how hard it is to do it well with VFP's grid, we're much more inclined to use an ActiveX control in those cases.Panel determines, in a split grid, which side has the focus. PanelLink determines whether the two sides are linked—that is, if you move to a new record on one side, do you move on the other side, too? View specifies which mode each side of the split uses or, if the grid is unsplit, which mode the whole grid uses.
Usage |
grdGrid.Panel = nWhoHasFocus nWhoHasFocus = grdGrid.Panel grdGrid.PanelLink = lLinked lLinked = grdGrid.PanelLink |
Usage |
grdGrid.View = nModes nModes = grdGrid.View |
The design-time appearance of a grid (or panel) in Change mode is totally useless. You can't tell anything about it. |
If you put controls other than text boxes in a grid, when you change the grid to use Change mode, it still uses your controls. (Of course, we haven't used a grid in Change mode yet.) |
Example |
* Split the grid ThisForm.grdMyGrid.Partition = 100 * Now use Browse mode on the left, Edit/Change mode on the right ThisForm.grdMyGrid.View = 1 * Unlink the two panels ThisForm.grdMyGrid.PanelLink = .F. * Set up each side the way you want it ThisForm.grdMyGrid.Panel = 0 && Left ThisForm.grdMyGrid.RowHeight = 30 ThisForm.grdMyGrid.GridLineColor = RGB(255,0,0) ThisForm.grdMyGrid.Panel = 1 && Right ThisForm.grdMyGrid.RowHeight = 25 ThisForm.grdMyGrid.GridLineColor = RGB(0,0,255) |
See Also |