Results 1 to 4 of 4

Thread: Simple DataGrid question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Posts
    255

    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!

  2. #2
    Member
    Join Date
    Aug 2008
    Posts
    59

    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Posts
    255

    Re: Simple DataGrid question

    that is what I want. Thanks. I even dont know there is msflexgrid in VB..

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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
  •  



Click Here to Expand Forum to Full Width