VB 6 -MSHFlexGrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jayachandra
    New Member
    • Mar 2007
    • 49

    VB 6 -MSHFlexGrid

    Hi to all,

    I have designed a form which contains MSFlexGrid control. Here the problem is I am getting the data into the FlexGrid from the database. But in the first column there is no data or text. But I want the serial no. in the first column like 1,2,3,4,5,6,... .....column wise upto data available. how to get it.

    Please give me an example.

    Thank u all.
    Jayachandra
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Instead of selecting the first column from the table select rownum ,if you are using Oracle as your backend. You will get the number from 1 to total number of records.

    Comment

    • Jayachandra
      New Member
      • Mar 2007
      • 49

      #3
      Thanks for reply.

      I have no Sl. No. column. in my database. Just I want to display the row numbers in the FlexGrid control. Thats it.

      Thank u

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by Jayachandra
        Thanks for reply.

        I have no Sl. No. column. in my database. Just I want to display the row numbers in the FlexGrid control. Thats it.

        Thank u
        If that is not in your DB then you can use your Flixgrid Row count like

        [CODE=vb]msfGrid.TextMat rix(1, msfGrid.Row) = msfGrid.Row[/CODE]

        Comment

        • kuzya
          New Member
          • Sep 2007
          • 3

          #5
          Hi guys,

          I'm sorry I didn't start a new thread but it looks like the right people are here ;o)
          I use MSFlexGrid in my app where I write results from db.
          Question: when I make multi selection in the grid how I can catch the selected row ids?
          Thanks!

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Can you explain what you mead for row Id?
            I think you are looking for selected value!

            to get selected value
            [CODE=vb]
            Dim strselectedInGr id as string

            strselectedInGr id = MSFlexGrid.Text[/CODE]

            Comment

            • kuzya
              New Member
              • Sep 2007
              • 3

              #7
              Originally posted by hariharanmca
              Can you explain what you mead for row Id?
              I think you are looking for selected value!

              to get selected value
              [CODE=vb]
              Dim strselectedInGr id as string

              strselectedInGr id = MSFlexGrid.Text[/CODE]
              Thanks for the reply
              Probably my question wasn't proper asked.
              OK, with the list where I select some items I can do the following:

              For i=0 to MyList.ListCoun t-1
              if MyList.Selected (i)=True Then
              ............... ............... ............... ..
              End If
              Next i

              I wanna do the same with the MSFlexGrid
              But it doesn't have the same property as the list does.
              How I can get MyGrid.Row of the selected rows?

              I'd appreciate any input.
              Thanks!

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                In MS flex grid we have Merge cells option trough column and row. So you cannot multi select option in this grid.
                Can you explain your problem why you want do that in MSFlxGrd. There is another options like list view and list box controls.

                Comment

                • kuzya
                  New Member
                  • Sep 2007
                  • 3

                  #9
                  Originally posted by hariharanmca
                  In MS flex grid we have Merge cells option trough column and row. So you cannot multi select option in this grid.
                  Can you explain your problem why you want do that in MSFlxGrd. There is another options like list view and list box controls.
                  I wrote a procedure which fills out the grid with db-results.
                  Sometime I need to delete multiple objects - I wanted to select them in the grid to avoid multi clicking on delete button ;o)
                  It looks like MSFlexGrid doesn't have this luxury

                  Thanks!

                  Comment

                  • hariharanmca
                    Top Contributor
                    • Dec 2006
                    • 1977

                    #10
                    Originally posted by kuzya
                    I wrote a procedure which fills out the grid with db-results.
                    Sometime I need to delete multiple objects - I wanted to select them in the grid to avoid multi clicking on delete button ;o)
                    It looks like MSFlexGrid doesn't have this luxury

                    Thanks!
                    Can you explain in which format you are going to delete. for the above procedure you have to use Listview control.

                    I you are deleting from Database then you have to execute the delete query and refill the grid with select query.

                    Comment

                    Working...