Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flexgrid formatting 1

Status
Not open for further replies.

cjac

Programmer
Dec 8, 2003
93
GB
Hi, I am trying to format a flexgrid at runtime. I'm having a little trouble getting the effect I want. Here's what I've got:

For rowi = 1 To rScount
With fgTermCodes
.FillStyle = flexFillRepeat
.row = rowi
.col = 0
.ColSel = 3
.CellBackColor = &HC0FFFF
.CellFontBold = False
End With
Next rowi

For coli = 0 To 3
With fgTermCodes
.FillStyle = flexFillRepeat
.row = 0
.col = coli
.CellBackColor = &HC0C0C0
End With
Next coli

I basically want the top row to be in grey and the cells to have a 3D effect and the rest of the grid in yellow and have flat style gridlines. However, my first column has bold gridlines despite numerous attempts to reset this.
 
Further to the above, I do not seem to be able to format column 0. Is there a reason for this?
 
Maybe I should be a little more specific. What I want to know is can you set the gridline style for a particular cell or will this effect the whole of the grid? Simililary, can I give a specific cell a 3D effect?

Cheers
 
This works for me. You need to set the .rowsel property so a row is actually selected to apply the changes to.

Code:
   Dim i As Integer
   
   With MSFlexGrid1
      .FillStyle = flexFillRepeat
      .Row = 0
      .RowSel = 0
      .Col = 0
      .ColSel = .Cols - 1
      .CellTextStyle = flexTextRaised
     For i = 1 To .Rows - 1        
        .Row = i
        .RowSel = i
        .Col = 0
        .ColSel = .Cols - 1
        .CellBackColor = &HC0FFFF
        .CellFontBold = False
      Next i
   End With

The grid lines are set for the entire grid. The only difference is fixed rows or columns and non fixed rows or columns.


Take Care,

zemp
 
To set the style of a specific cell,

Code:
   With MSFlexGrid1
      .Row = 3
      .Col = 3
      .CellTextStyle = flexTextRaised
   End With


Take Care,

zemp
 
Thanks for the response zemp. However I am still having problems with this: my first column cell on my selected row does not fill despite the following code being in place:

With fgTermCodes
.FillStyle = flexFillRepeat
.row = curRow
.col = 0
.ColSel = 3
End With

Any ideas as to why my first cell on the selected row will not highlight?

Cheers
 
Is the first cell a fixed column? does that cell have the focus and does it have a focus rectangle? What is the selection mode for the grid? I usually have it set to selection by row and No focus rectangle. Try playing with those properties and see if you can get what you want.

Take Care,

zemp
 
Hit the nail on the head there zemp - fixed col and focus rectangle properties re-jigged and all is now well.

Cheers
cjac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top