Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Using Flexgrid .net

Using Flexgrid .net

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasedata-structuresannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    welbert
    wrote on last edited by
    #1

    Hello again, Need help on this code. Im using Flexgrid control the .net version... dont know what to do about this one.. it produce an error stating "Index was outside the bounds of the array... For intCount = 0 To 10 grid1.Cell(0, intCount).Text = "Hello" Next But when i tried it this way.. ( grid1.cell(0,1).text = "Hello" );).. this works... but if i used for next it produces error.. pls help... your help is highly appreciated............. tnx in advance..

    M D S 3 Replies Last reply
    0
    • W welbert

      Hello again, Need help on this code. Im using Flexgrid control the .net version... dont know what to do about this one.. it produce an error stating "Index was outside the bounds of the array... For intCount = 0 To 10 grid1.Cell(0, intCount).Text = "Hello" Next But when i tried it this way.. ( grid1.cell(0,1).text = "Hello" );).. this works... but if i used for next it produces error.. pls help... your help is highly appreciated............. tnx in advance..

      M Offline
      M Offline
      Muhammad Javed Khan
      wrote on last edited by
      #2

      First confirm that gird should have 10 rows and start the loop with 1 may be grid index starts from 1..... For intCount = 1 To 10 'Start with 1 instead of 0 grid1.Cell(0, intCount).Text = "Hello" Next Regards

      1 Reply Last reply
      0
      • W welbert

        Hello again, Need help on this code. Im using Flexgrid control the .net version... dont know what to do about this one.. it produce an error stating "Index was outside the bounds of the array... For intCount = 0 To 10 grid1.Cell(0, intCount).Text = "Hello" Next But when i tried it this way.. ( grid1.cell(0,1).text = "Hello" );).. this works... but if i used for next it produces error.. pls help... your help is highly appreciated............. tnx in advance..

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        First, there is no .NET version of the MSFlexGrid. It's just an old ActiveX control that you can still use in your app though. How many row does your grid have? Your loop says there are 11, number 0 trough 10. If you do have 10 rows, they'll be numbered 0 through 9.

        For intCount = 0 To 9
        grid1.Cell(0, intCount).Text = "Hello"
        Next

        RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        1 Reply Last reply
        0
        • W welbert

          Hello again, Need help on this code. Im using Flexgrid control the .net version... dont know what to do about this one.. it produce an error stating "Index was outside the bounds of the array... For intCount = 0 To 10 grid1.Cell(0, intCount).Text = "Hello" Next But when i tried it this way.. ( grid1.cell(0,1).text = "Hello" );).. this works... but if i used for next it produces error.. pls help... your help is highly appreciated............. tnx in advance..

          S Offline
          S Offline
          Suelinda_W
          wrote on last edited by
          #4

          Hello welbert, There was a Microsoft FlexGrid for VB 6, but it should still be available in .NET, although it will probably not . Is this what you are using. It was based on an old version of our VSFlexGrid. We, ComponentOne, also have an updated FlexGrid for .NET 1.x and 2.0. I am not sure which one you are using, but each version has the rows indexed from 0, so you are right to start intCount at 0. Keep in mind that 0 to 10 is 11 rows, not 10 rows. If you want to add "Hello" to all rows, it would be better to use For intCount = 0 to Grid1.Rows.Count -1 Grid1.Cell(0, intCount).Text = "Hello" Next This way you know that the index will always be in range, even if rows are added or deleted later. If you still have trouble, please let me know exactly which grid you are using, and which build, then I can provide better assistance. Suelinda W Customer Engagement, ComponentOne LLC

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups