CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: MSFlexGrid

  1. #1
    Guest

    MSFlexGrid

    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.


  2. #2

    Re: MSFlexGrid

    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


  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: MSFlexGrid

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured