Results 1 to 4 of 4

Thread: Merged cells selection on a MSFlexGrid

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    160

    Merged cells selection on a MSFlexGrid

    I'm a bit lost on this one... when several cells in a FlexGrid are merged both row/col and rowsel/colsel are always pointing to just one of the cells that are part of the merged one, so if you change one of its properties you don't change it for all the cells.

    I'd like to know how you'd solve this, since the only methods I can think of right now are using two for loops, or modifying the database fields where these properties are set and reload the grid, and maybe the people with more experience know of some other better way.

  2. #2

  3. #3
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Merged cells selection on a MSFlexGrid

    Quote Originally Posted by Neverbirth
    When several cells in a FlexGrid are merged both row/col and rowsel/colsel are always pointing to just one of the cells that are part of the merged one, so if you change one of its properties you don't change it for all the cells.
    You can do it changing FillStyle property value:
    VB Code:
    1. With MSFlexgrid1
    2.      .Row = 1
    3.      .Col = 1
    4.      .RowSel = 5
    5.      .ColSel = 3
    6.  
    7.      .FillStyle = flexFillRepeat
    8.          'Make your multicell changes here, like..
    9.          .CellBackColor = VbYellow
    10.          .CellForecolor = VbBlue
    11.      .FillStyle = flexFillSingle
    12. End With

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    160

    Re: Merged cells selection on a MSFlexGrid

    Quote Originally Posted by RhinoBull
    Somebody asked simmilar question:

    http://www.vbforums.com/showthread.php?t=442733
    Thanks for the link, although I don't see any piece of code that gives hints about my problem.

    Quote Originally Posted by jcis
    You can do it changing FillStyle property value:
    Well, that wouldn't fully solve my problem anyway, since it also requires knowing beforehand where the merged cell begins and where it ends.

    Anyway, from reading both replies I guess another method (although not very accurate and could give some problems) would be to change the fillstyle value, select a great amount of cells around the selected one and change the back colour to the ones that have the same original properties, like text, colour, picture, etc. It would be a bit faster that doing two for loops...

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