FlexGrid For Yes/No Option--Like CheckBox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shrividya
    New Member
    • Feb 2008
    • 2

    FlexGrid For Yes/No Option--Like CheckBox

    Can i had a CheckBox in FlexGrid for Yes/No option. So that multiple records can be selected.
    Plz help me to come out with some result.
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    There is one Simple Way , To make a Column Check box in MSFlexGrid..

    Say, you want to make Column 4 as Selection Column.
    FontName Marlett has character "b" looking like a Check-Mark Icon.
    What you can do is Set whole of the column name = "Marlett", and In Click-event Toggle between "b" and empty...


    Write this code in Grd_Click Event:

    [code=vb]
    If Grd.Row >0 And Grd.Col=4 Then
    Grd.CellFontnam e ="Marlett"
    If Trim(Grd.Text) = "" Then
    Grd.Text ="b"
    Else
    Grd.Text = ""
    End If
    End If
    [/code]

    And In Save/Print Button, Loop thru the Rows, and Check For

    [code=vb]
    If Trim(Grd.TextMa trix(2,4)) ="b" Then
    MsgBox "Row 2 Selected"
    Else
    MsgBox "Row 2 Not Selected"
    End If
    [/code]
    It will indicate Selected Row.

    Alternatively, Webdings font has also got font "a" looking like a Check Mark..
    you can use Either..


    Regards
    Veena

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You can also use some third party tools available free of cost.

      Comment

      • exedotsree
        New Member
        • Mar 2008
        • 8

        #4
        Originally posted by QVeen72
        Hi,

        There is one Simple Way , To make a Column Check box in MSFlexGrid..

        Say, you want to make Column 4 as Selection Column.
        FontName Marlett has character "b" looking like a Check-Mark Icon.
        What you can do is Set whole of the column name = "Marlett", and In Click-event Toggle between "b" and empty...


        Write this code in Grd_Click Event:

        [code=vb]
        If Grd.Row >0 And Grd.Col=4 Then
        Grd.CellFontnam e ="Marlett"
        If Trim(Grd.Text) = "" Then
        Grd.Text ="b"
        Else
        Grd.Text = ""
        End If
        End If
        [/code]

        And In Save/Print Button, Loop thru the Rows, and Check For

        [code=vb]
        If Trim(Grd.TextMa trix(2,4)) ="b" Then
        MsgBox "Row 2 Selected"
        Else
        MsgBox "Row 2 Not Selected"
        End If
        [/code]
        It will indicate Selected Row.

        Alternatively, Webdings font has also got font "a" looking like a Check Mark..
        you can use Either..


        Regards
        Veena
        Hi

        This thread helped me. It's simply superb.. It looks great..
        Thank you.

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Hi,

          Welcome :)

          --Veena

          Comment

          Working...