Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,908 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,191 people online right now. Registration is fast and FREE... Join Now!




Strange problem with Flex Grid

 
Reply to this topicStart new topic

Strange problem with Flex Grid

pe_mitev
1 Feb, 2008 - 05:34 AM
Post #1

D.I.C Head
Group Icon

Joined: 28 Dec, 2007
Posts: 72


Dream Kudos: 50
My Contributions
Hello everybody! Yesterday, I decided to remember how to work with Ms Flex Grid in VB.NET. I decided to create 20 columns and 20 rows and titles of columns to be A,B,C,D,E.... and names titles of rows 1,2,3,4,5. But there is a problem when I use a variable. This is the code:
I will show only the snippet for naming rows.

CODE

Grid.Rows = 20
Grid.Cols = 20

Dim i as Integer

Grid.Col = 0 'We will use the 0 column which actually is the title column

For i = 1 To 20

Grid.Row = i 'This is the problem. If I use static number, for example 5 it will work.
Grid.Text = i

Next


The same problem appears if I want to make Grid.Row = 0 and create a loop for naming columns A,B,C,D.

I do not know why it does not accept values from variables. It is very strange. There error is actually an address in the memory(Not Recognized by VS 2005).
User is offlineProfile CardPM
+Quote Post

Nayana
RE: Strange Problem With Flex Grid
3 Feb, 2008 - 08:53 PM
Post #2

DIC Hawk - 나야나 नयन:
Group Icon

Joined: 14 Nov, 2007
Posts: 824



Thanked: 5 times
Dream Kudos: 175
My Contributions
Try Grid.Text = i.ToString()

But... why are you using the MSFlexGrid anyway? That's a bit obsolete. .net comes with a perfectly suitable DataGridView
User is offlineProfile CardPM
+Quote Post

pe_mitev
RE: Strange Problem With Flex Grid
4 Feb, 2008 - 09:59 AM
Post #3

D.I.C Head
Group Icon

Joined: 28 Dec, 2007
Posts: 72


Dream Kudos: 50
My Contributions
Hm, you ask me an interesting question. I am not sure why I am using Flex Grid. It is good for the work I need it but maybe in further versions I will upgrade to DataGrid. Thank you for the help, the problem had been solved from itself if I can say it that way smile.gif.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 01:31PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month