Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How can I expand the DBGrid columns?

How can I expand the DBGrid columns?

How can I expand the DBGrid columns?

The default columns for DBGrid (VB5) have only two columns. I need to add more columns to the Grid. How can I do it? Thanks

RE: How can I expand the DBGrid columns?

The Dbgrid changes the number of columns depending on the number of fields from the recordset.

RE: How can I expand the DBGrid columns?

Hi, Hug:

Thanks for your replay, I thought the same thing when I worked on VB4 with add-on Dbgrid. But, however, my program in VB5 would not do it. It only shows two columns from my access table which has about 50 fields ( I need five fields to display) Do you know how can I get round it?

RE: How can I expand the DBGrid columns?

If your DBGrid is bound to a data control and the database and recordsource properties are filled in just right click on the grid and select Retrieve Fields. This will pull all of the table fields onto your grid. If you don't want all of the fields set the Visible property for thoe columns to false by unchecking the visible box on the Layout tab of the properties box.

If your grid is unbound you can use code to set the number of columns and column properties.

RE: How can I expand the DBGrid columns?

It happened to me too once, I fixed just changed the columns property on the dbgrid and voila!.
Check also the recorsource on the data control, the dbgrid bounds to the number of fields on the recorset at design.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close