Click to See Complete Forum and Search --> : Flex Grid


nmd
September 28th, 1999, 04:31 PM
In a Flexgid control i want to Print all column headings with font 'bold', but all the values in the cell to normal font.
also for flexgrid i want to set the values in the cell to center align . i used msflex.Cellalignment = flexAlignCenterCenter.
it worked only for first cell. i want all cells to be center aligned.
can any one tell me how to do that?


Thanks in advance.
Bill

Dr_Michael
September 29th, 1999, 03:55 AM
for i = 0 to NumberOfRows
MSFlexGrid1.CellAlignment = vbCenter
if i=0 then MSFlexGrid1.CellFontBold = true
next i




Michael Vlastos
Automation Engineer
Company Modus SA
Development Department

Chris Eastwood
September 29th, 1999, 12:20 PM
Here's an easy way to handle the centering of all cells (excluding fixed rows/columns) :


With YourFlexGridControl
.Redraw = false ' turn of flickering / highlight
.FillStyle = flexFillRepeat ' apply to all selected cells
.Col = .FixedCols ' set col
.Row = .FixedRows ' set row
.ColSel = .Cols - 1 ' set selected col position
.RowSel = .Rows - 1 ' set selected row position
.CellAlignment = flexAlignCenterCenter ' apply cell alignment to all
.Col = 0 ' reset col
.Row = 0 ' reset row
.Col = .FixedCols
.Row = .FixedRows
.FillStyle = flexFillSingle
.Redraw = true
End With





Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

nmd
October 1st, 1999, 03:09 PM
Thank you very much. It worked fine. also is it possible in Flex grid to print column headings in 'bold' and all other values to not bold?

Bill.

Chris Eastwood
October 1st, 1999, 05:26 PM
You can use the same (kind-of) code snippet -


With MSFlexGrid1
.Redraw = false ' turn of flickering / highlight
.FillStyle = flexFillRepeat ' apply to all selected cells
.Col = .FixedCols ' set col
.Row = 0 ' set row
.ColSel = .Cols - 1 ' set selected col position
.RowSel = .FixedRows ' set selected row position
.CellAlignment = flexAlignCenterCenter ' apply cell alignment to all
.CellFontBold = true
.Col = 0 ' reset col
.Row = 0 ' reset row
.Col = .FixedCols
.Row = .FixedRows
.FillStyle = flexFillSingle
.Redraw = true
End With




This will center and make bold all of the column headers in the flexgrid.


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

nmd
October 4th, 1999, 10:08 AM
Thank you very much for your reply.


Bill