Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27173

C1 Flexgrid Help

$
0
0
Hi All

I'm using the C1 Flexgrid for .net and I just cannot figure out how to set different cell fonts, I'm populating a notice board and the user can select different fonts like bold, underline etc. The C1 help files are terrible and I'm finding no luck on the net. When the below code executes I don't get any errors and the grid is populating with the data but the font styles are just not setting. Please could someone point me in the right direction.

Code:

      'Grid declares'
        Dim FontNormal As C1.Win.C1FlexGrid.CellStyle
        Dim FontBold As C1.Win.C1FlexGrid.CellStyle
        Dim FontItalic As C1.Win.C1FlexGrid.CellStyle
        Dim FontStrikeOut As C1.Win.C1FlexGrid.CellStyle
        Dim FontUnderline As C1.Win.C1FlexGrid.CellStyle
        FontBold = fgMessage.Styles(C1.Win.C1FlexGrid.Classic.CellPropertySettings.flexcpFontBold)
        FontNormal = fgMessage.Styles(C1.Win.C1FlexGrid.Classic.CellPropertySettings.flexcpFont)
        FontItalic = fgMessage.Styles(C1.Win.C1FlexGrid.Classic.CellPropertySettings.flexcpFontItalic)
        'FontStrikeOut = fgMessage.Styles(C1.Win.C1FlexGrid.Classic.CellPropertySettings.flexcpFontStrikethru)
        FontUnderline = fgMessage.Styles(C1.Win.C1FlexGrid.Classic.CellPropertySettings.flexcpFontUnderline)

        'Populate the Daily notice board'
        ssQL("SELECT * FROM Notice_Board (NOLOCK) ORDER BY Line_No")
        fgMessage.Row = 0
        While Not rs.EOF
            fgMessage.Row = fgMessage.Row + 1
            fgMessage.Item(fgMessage.Row, 0) = rs.Fields("Description").Value.ToString
            Select Case rs.Fields("Style").Value.ToString
                Case "Font Normal"
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontNormal)
                Case "Font Bold"
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontBold)
                Case "Font Underline"
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontUnderline)
                Case "Font StrikeOut"
                    'fgMessage.SetCellStyle(fgMessage.Row, 0, FontStrikeOut)
                Case "Font Italic"
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontItalic)
                Case "Bold & Underline"
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontBold)
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontUnderline)
                Case "Bold & Italics"
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontBold)
                    fgMessage.SetCellStyle(fgMessage.Row, 0, FontItalic)
                Case "Reset Fonts"

            End Select
            rs.MoveNext()
        End While
        rs.Close()

Many Thanks in advance
AJ

Viewing all articles
Browse latest Browse all 27173

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>