Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grids 1

Status
Not open for further replies.

GuitarSlayer

Programmer
Dec 16, 2004
29
0
0
GB
Hi,

I wonder can anyone give me any pointers. I have a grid which at design time has a column with a checkbox in it. I have a method in my form which amongst other things binds the column to logical data field. So far so good! however anytime I call this method once the form is active to clear out the grid, and repopulate it I can't get the damn checkbox to display in the column, all I get is 'F' which I assume is the value of the logical field that bound to it! I've made sure the currentcontrol is set to the checkbox but no luck!
 
I can't get the damn checkbox to display in the column, all I get is 'F' which I assume is the value of the logical field that bound to it! I've made sure the currentcontrol is set to the checkbox but no luck!

Did you set the column's Sparse property to .F. ?

Marcia G. Akins
 
Mmmm tried that Marcia but it did'nt make any difference. I also notice that when I repopulate the grid for some reason the checkbox that I added to the column at design time, no longer exists! If I inspect the column in the debugger sure enough the checkbox has disappeared, Ugh! don't like that!
 
GuitarSlayer,

How are you populating the grid? Are you using a cursor? If so, when you want to repopulate the grid, do you run a query to recreate the cursor?

If so, that could be the cause of the problem. When you run a query to re-generate a cursor, the existing cursor will first be destroyed and then re-created. If the cursor is the RecordSource of the grid, the grid will briefly lose its columns and all the controls within the columns.

You can work round this by detaching the cursor from the RecordSource before you regenerate it (that is, set the RecordSource to an empty string, then generate the cursor, the reset the RecordSource to point to the cursor).

For more information, see "Controlling grid data dynamically", at:

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top