|
-
Sep 9th, 2008, 11:35 PM
#1
Thread Starter
Addicted Member
Simple DataGrid question
Dear all,
I am new to VB 6.0 and my question for datagrid is as follow:
I have to write a program to display error message to user. Each message will have two columns. One is Error Number, the other column is Error Details.
For example, i want to have the following output in the datagrid if a user encounters two errors:
Error Number Error Details
------------- --------------
1123 Integer is not allow
1236 Field is too long.
In the VB 6.0, I just add a datagrid to a form, and then write the following code:
datagrid1.AllowAddNew = True
datagrid1.Row = 1
datagrid1.Columns.Item(0).Text = "1123"
datagrid1.Columns.Item(1).Text = "Integer is not allow"
But when i run the above code, it says "rowset not available". do you know why?
thanks in advance!
-
Sep 10th, 2008, 02:18 AM
#2
Member
Re: Simple DataGrid question
I hate datagrids.
flexgrids seem to have more tutorials out for, I'd use a flexgrid if I were you. When I was looking into them I couldn't find many people with experience using datagrids.
-
Sep 10th, 2008, 03:57 AM
#3
Thread Starter
Addicted Member
Re: Simple DataGrid question
that is what I want. Thanks. I even dont know there is msflexgrid in VB..
-
Sep 10th, 2008, 05:35 AM
#4
Re: Simple DataGrid question
Welcome to VBForums 
There is definitely no need for a DataGrid here, as you aren't getting the data from a database (even if you were, I would still recommend something else!).
To add the FlexGrid go to "Project"->"Components", and select "Microsoft FlexGrid control"
You can use code like this to put data into it:
Code:
MSFlexGrid1.Cols = 2
MSFlexGrid1.AddItem "1123" & vbTab & "Integer is not allow"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|