Using Flexgrid .net
-
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..
-
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..
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 -
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..
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"
NextRageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
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..
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