• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

Clearing DBGrid

How do you clear an unbound DBGrid after loading it with an array.  The ClearFields method does not work, but that is exactly what I want it to do.  Please help!
0
globe
Asked:
globe
1 Solution
 
majed100598Commented:
dbgrid1.fixedrows=0
dbgrid.rows=1

then define the number of fixed rows and columns you want
0
 
globeAuthor Commented:
There's no FixedRow or Rows property/method for DBGrid in VB5.  
0
 
myqlGCommented:
he was almost right
dbgrid1.rows=1
dbgrid1.cols=1
(You can try 0 but I think that creates an error)
There is also a dbgrid1.clearfields
good luck
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
globeAuthor Commented:
Again, the Rows property does not apply to DBGrid in VB5, although the Help file claims that it does.
0
 
MirkwoodCommented:
Maybe it is not an easy question?
0
 
MirkwoodCommented:
Ok, so far 10000 points I tell you that DBGrid1.ClearFields might do what you want.
Oeps, I already gave you the answer :-(
0
 
globeAuthor Commented:
I stated in my question that  the Clearfields method will give me exactly what I want.  However, I can not make it to work with unbound DBGrid.  In fact, it does nothing.  I found myself a work-around already.  Thanks though.
0
 
vinoopaulsCommented:
redim the array to nothing and refresh the dbgrid
this will clear the unbound dbgrid for you
0
 
globeAuthor Commented:
Thank You!  This works!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now