UBGrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WhiteShore
    New Member
    • Nov 2007
    • 44

    UBGrid

    Hi there..
    I just wondering are there anyone ever use UBGrid?
    it's a standalone program for VB 6.0 that can add checkbox to the grid.


    Thanks....
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    If you want only for Check Box, you can very well use MSFlexGrid only..

    Regards
    Veena

    Comment

    • WhiteShore
      New Member
      • Nov 2007
      • 44

      #3
      To. Ms Veena,
      for msflexgrid, will the item data editable?
      and how to put a checkbox with msflexgrid?

      thanks in advance..

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        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...To Chaneg Font of whole column, write this Code after populating the Grid:
        [code=vb]
        Dim i As Integer
        For i = 1 To Grd.Rows-1
        Grd.Row =i
        Grd.Col=4
        Grd.CellFontnam e ="Marlett"
        Next
        [/code]
        Write this code in Grd_Click Event:

        [code=vb]
        If Grd.Row >0 And Grd.Col=4 Then
        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.
        This Logic works fine for me..
        Alternatively, Webdings font has also got font "a" looking like a Check Mark..
        you can use Either..

        If you search the Web, many people suggest you to use an Icon or Picture of a Check Mark and load /Remove the Image from the FlexGrid Cell. this is too tedious.

        Regards
        Veena

        Comment

        • WhiteShore
          New Member
          • Nov 2007
          • 44

          #5
          Dear Ms.Veena,
          you really rocks...!!
          it's working, although there's no change to the cell font, it still ms sans serif, but that's ok, maybe im gonna use "Yes" as a check mark.
          But sadly i cant edit data value of msflexgrid,
          i wonder why there's no "AllowUpdat e" properties as in DataGrid.

          But thanks so much for your help!!
          If only i could do something for you in return .. =)

          Comment

          • lotus18
            Contributor
            • Nov 2007
            • 865

            #6
            What does the UBGrid looks like? Is it the same as FlexGrid? I never encountered this control before : )

            Comment

            • WhiteShore
              New Member
              • Nov 2007
              • 44

              #7
              Dear lotus18,

              yep it just like other's grid..
              but it can put checkbox, combobox, etc inside the grid..

              but i dont know how to use it though,
              just found it on google search
              =)

              Comment

              • lotus18
                Contributor
                • Nov 2007
                • 865

                #8
                Originally posted by WhiteShore
                Dear lotus18,

                yep it just like other's grid..
                but it can put checkbox, combobox, etc inside the grid..

                but i dont know how to use it though,
                just found it on google search
                =)
                Wow

                It sounds amazing. I'll try that grid later : )

                Comment

                • QVeen72
                  Recognized Expert Top Contributor
                  • Oct 2006
                  • 1445

                  #9
                  Originally posted by WhiteShore
                  Dear Ms.Veena,
                  you really rocks...!!
                  it's working, although there's no change to the cell font, it still ms sans serif, but that's ok, maybe im gonna use "Yes" as a check mark.
                  But sadly i cant edit data value of msflexgrid,
                  i wonder why there's no "AllowUpdat e" properties as in DataGrid.

                  But thanks so much for your help!!
                  If only i could do something for you in return .. =)
                  Hi,

                  Glad, it could help you.
                  If you really want a Robust Editable Grid, then go for VSFlexGrid.
                  Its really cool, and you can set all the Properties @ Design Time (like Say Column Width, Row Height, ) and Column Property like CheckBox/Combo/Button/TextBox..etc..

                  Regards
                  Veena

                  Comment

                  • WhiteShore
                    New Member
                    • Nov 2007
                    • 44

                    #10
                    Originally posted by QVeen72
                    Hi,

                    Glad, it could help you.
                    If you really want a Robust Editable Grid, then go for VSFlexGrid.
                    Its really cool, and you can set all the Properties @ Design Time (like Say Column Width, Row Height, ) and Column Property like CheckBox/Combo/Button/TextBox..etc..

                    Regards
                    Veena
                    That's ok, i've found a way to edit the data value from msflexgrid.
                    Thanks so much for your help.. =)

                    Comment

                    • werks
                      New Member
                      • Dec 2007
                      • 218

                      #11
                      Good day,

                      I'm downloading UBGrid but i don't know how to use it.. can anyone help me?


                      Better Than Yesterday (-.-)

                      Comment

                      • WhiteShore
                        New Member
                        • Nov 2007
                        • 44

                        #12
                        Dear Ms. Veena and other experts,
                        I was trying to save the content of Msflexgrid for all rows that have the "b" value.

                        [CODE=vb]If cboSales.Text = "" Then
                        MsgBox "Choose Sales No!"
                        Else
                        With rs
                        .ActiveConnecti on = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=salesdb. mdb;Persist Security Info=False"
                        .CursorLocation = adUseClient
                        .LockType = adLockOptimisti c
                        .CursorType = adOpenStatic
                        .Source = "SELECT * FROM Sales"
                        .Open

                        For i = 1 To MSFlexGrid1.Row s - 2
                        If MSFlexGrid1.Tex tMatrix(i, 4) = "b" Then
                        If Not MSFlexGrid1.Tex tMatrix(i, 3) < 1 Then
                        .AddNew
                        .Fields(0).Valu e = txtNoSO.Text
                        .Fields(1).Valu e = cboSales.Text
                        .Fields(2).Valu e = dtDate.Value
                        .Fields(3).Valu e = cboCust.Text
                        .Fields(4).Valu e = MSFlexGrid1.Tex tMatrix(i, 0) 'item name
                        .Fields(5).Valu e = MSFlexGrid1.Tex tMatrix(i, 3) 'item qty
                        .Update
                        End If
                        Else
                        MsgBox "Please insert a valid qty!"
                        End If
                        Else
                        MsgBox "There's nothing to insert!"
                        End If
                        Next
                        End With
                        End If[/CODE]

                        I wonder why it only save the first row and then it show an error.
                        its kinda confusing me..

                        Comment

                        • QVeen72
                          Recognized Expert Top Contributor
                          • Oct 2006
                          • 1445

                          #13
                          Hi,


                          Try to change your second IF to :

                          If Val(MSFlexGrid1 .TextMatrix(i, 3)) > 0 Then

                          Not very sure of the Fields, Use Val( ) Wherever, you are trying to save a Numeric expression, Open the Recordset as Dynamic, instead of Static,
                          and change the For Loop to :

                          For i = 1 To MSFlexGrid.Rows-1

                          Regards
                          Veena

                          Comment

                          • WhiteShore
                            New Member
                            • Nov 2007
                            • 44

                            #14
                            I've made a changed and it still show an error "Subscript out of range".
                            When i pressed on debug button,
                            it highlighted this part.

                            If MSFlexGrid1.Tex tMatrix(i, 4) = "b" Then

                            and still only the first row's item being saved.

                            Comment

                            • QVeen72
                              Recognized Expert Top Contributor
                              • Oct 2006
                              • 1445

                              #15
                              Hi,

                              revert back to .Rows-2

                              Try this FOR Loop

                              [code=vb]
                              For i = 1 To MSFlexGrid1.Row s - 2
                              If MSFlexGrid1.Tex tMatrix(i, 4) = "b" And Val(MSFlexGrid1 .TextMatrix(i, 3)) > 0 Then
                              .AddNew
                              .Fields(0).Valu e = txtNoSO.Text
                              .Fields(1).Valu e = cboSales.Text
                              .Fields(2).Valu e = dtDate.Value
                              .Fields(3).Valu e = cboCust.Text
                              .Fields(4).Valu e = MSFlexGrid1.Tex tMatrix(i, 0)
                              .Fields(5).Valu e = MSFlexGrid1.Tex tMatrix(i, 3)
                              .Update
                              End If
                              Next
                              [/code]

                              How many rows are there in Grid..?
                              What is the PK of the table..?

                              Regards
                              Veena

                              Comment

                              Working...