Click to See Complete Forum and Search --> : MSFlexGrid
November 17th, 1999, 02:17 PM
I'm basing a data retrieval on a form based on a selected row in the MSFlexGrid on the previous form (the form is VBModal, so it is accessible at the time). If the command button is clicked and no row is selected, the form shouldn't load, but if there is a row selected I want the data from that row to perform the query. They "selected row" does give me access to the data...no problem. However, even if there is no row selected, the form is still loaded. I can't find a property to tell me if no row is selected or a way to "force" no row to be so the form won't be loaded. Any suggestions? Even an alternative to the MSFlexGrid would/could be a viable solution. Thx in advance.
Robt.
czimmerman
November 17th, 1999, 04:26 PM
The Microsoft DBGrid control's row property returns -1 if no row is selected. You can use this grid in unbound mode if you don't want to bind to a data control
Charlie Zimmerman
http://www.freevbcode.com
Ravi Kiran
November 18th, 1999, 02:40 AM
Hi,
In MSFlexGrid there are two ways to get the row is selected or Not.
1. Set the SelectoinMode Property to "SelectionByRow", which will always select one row, on click anywhere on the row
But if this situation is not acceptable, and you want to allow each cell movement also,
then :
2. Use RowCel/ColSel and Row/Col properties together to determine if a Column/Row is selected.
Note that the only way user can select a fullrow in "Freeselectionmode" is by clicking on Fixed column.
When you click on FixedColumn, the .RowSel will be Different from .Row property automatically implying that a Row has been selected. If a Row is not selected the values of .RowSel will be equal to .Row always. Catch on this to solve your case.
RK
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.