Results 1 to 24 of 24

Thread: FlexGrid Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482

    FlexGrid Question

    Is there a way to SPECIFY the width of EACH column in the flexgrid?
    ??

  2. #2
    Lively Member Ali G's Avatar
    Join Date
    Nov 2001
    Location
    Staines
    Posts
    120
    use dis wicked code, aii
    VB Code:
    1. MSFlexGrid1.ColWidth(0) = 1000

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Kick Ass.
    Is that in Pixels, Twips, or what?

  4. #4
    Lively Member Ali G's Avatar
    Join Date
    Nov 2001
    Location
    Staines
    Posts
    120
    usually twips, but I fink it depends on da scalemode of da form, aii

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Alright, Kickass.

    Thanks.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    What about pictures.
    Can you put an ICON or IMAGE in a column?

  7. #7
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    296
    progeix, your question did help me too. Thanks Ali etc...

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Originally posted by CutePretty
    progeix, your question did help me too. Thanks Ali etc...
    Cool. That's always good.



    Oh, ONE last question, That I have:
    Is there a way to make it so you can *ONLY* select one row at a time. It allows you to select as many as you want, and I need it to select ONLY one row at a time.

  9. #9
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by progeix
    What about pictures.
    Can you put an ICON or IMAGE in a column?
    Select column and row thn

    Me.msflexgrid1.cellpicture=loadpicture() ' Put picture path or imagelist reference....
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  10. #10
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    As far as selecting by column...

    grid.AllowBigSelection = False
    grid.SelectionMode = flexSelectionByColumn
    grid.FocusRect = flexFocusNone


    play with these. Selection Mode is the key, but check the other
    settings to get the grid to look like you need.

    -Enjoy
    Merry Christmas

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Ohhh... I'm sorry, I wasn't very clear.

    I mean like, If you click a row, all the columns IN that row will light up.

    BUT, If you SELECT a row, and drag the cursor down, you can select MULTIPLE rows..

    I need it so, you can only select one whole row at a time...

    If you need a picture, i'll be happy to produce one.

  12. #12
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    You can fake it by setting the select hilight color to the backcolor of the grid.

    To my knowleddge there is not a way to stop multiple selecting...

    You can force SELECTIONBYROW, but user can still highlight more than 1 row.

    I just store the row on the ENTERCELL event, and set my column picture on that row...

    Does this make sense?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  13. #13
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    grid.AllowBigSelection = False
    grid.SelectionMode = flexSelectionByRow


    Try that.
    Merry Christmas

  14. #14
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    ah.

    I left something out of that last one.

    on the click event,

    set grid.row = grid.rowsel

    This will set the row to the last clicked row.
    Merry Christmas

  15. #15
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    I just store the row on the ENTERCELL event
    That's what I meant...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Salright? Salright.

    I did that, and

    "Wrong number of arguments or invalid property assignment"

    Anyone know?

  17. #17
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    I don't know if you were responding to me or Mr. Stanich.

    Basically we do the same thing.
    He stores the value to a variable of the last row entered, and
    I set the row highlight to the last selected row...

    either or.

    But, if you were talking to me, don't use the set with the grid.row.

    the code would read

    grid.row = grid.rowsel


    like that, no set. my bad.

    good luck.
    Merry Christmas

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Originally posted by JPicasso
    I don't know if you were responding to me or Mr. Stanich.

    Basically we do the same thing.
    He stores the value to a variable of the last row entered, and
    I set the row highlight to the last selected row...

    either or.

    But, if you were talking to me, don't use the set with the grid.row.

    the code would read

    grid.row = grid.rowsel


    like that, no set. my bad.

    good luck.
    It's still letting me select many rows =/

  19. #19
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Re: Well

    Originally posted by James Stanich
    You can fake it by setting the select hilight color to the backcolor of the grid.

    To my knowleddge there is not a way to stop multiple selecting...

    You can force SELECTIONBYROW, but user can still highlight more than 1 row.

    I just store the row on the ENTERCELL event, and set my column picture on that row...

    Does this make sense?
    As I said, and I've asked before, there is no known way to stop this... Fake it yes, but not stop it....

    Attached is how I do it...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    Sorta done something

    on the MOUSEMOVE event,

    "List.Row = List.RowSel"

    That works, except it only "selects" the first COLUMN in that row. anyway to get it to select all of the columns in that row?

  21. #21

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    SALRIGHT!


    Private Sub List_SelChange()
    List.Row = List.RowSel
    List.ColSel = 2
    End Sub

    Works flawlessly.
    you can SELECT all of the rows, but once you let go.. it only selects one

    SHIFT+ARROW KEYS doesn't work either.

    perhaps there is more code to drag only one selection over the rows.. i'll work on it

    Cheers

  22. #22
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    yeh I played with this too. I selected the row and set my picture after the user stops playing...

    You think MS would have offred this option...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  23. #23
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    James, thats one nice looking grid! Hey now!

    ---
    progeix,
    I guess I forgot something in the get-one-row-to-highlight code.

    on the grid setup, I set:

    grid.SelectionMode = flexSelectionByRow
    grid.AllowBigSelection = False
    grid.FocusRect = flexFocusNone

    then in the click event...

    grid.row = grid.rowsel
    grid.col = 0
    grid.colsel = grid.cols -1

    I forgot about the columns. It's been a while since I wrote that.

    The flex grid is a great tool, if you don't mind some manual coding.
    I'm guessing some of the comercial controsl out there are better.
    There outta be an easier way...
    Merry Christmas

  24. #24
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    The flex grid is a great tool, if you don't mind some manual coding.
    It's universal, but it leaves the Whistles and Bells alone. I use it extensively, and most of the time, have found it to suit most of the need.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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