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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Click Event problem

Status
Not open for further replies.

StewartUK

Programmer
Feb 19, 2001
860
GB
I have a container class (designed to show biography details about a contact). There is a grid, and the click event (of the grid) has code in it to append a blank record, which works when there is no data. I have set the ColumnCount to 2.

I have subclassed the container (for creating new contact records), calling it ctrNewContact.

I have changed the RecordSource property in ctrNewContact's grid. The table in RecordSource has no records in it to start with.

I have also written new code into the click and refresh events without calling the event code in the Parent container's grid. I think this means that the code in the event should run followed, by the base class action - is that right?

When I put ctrNewContact on to a form and run the form, the grid does not react to a click on it, whereas the grid in the original container does.

Can anyone suggest where I might have gone wrong?

Thanks,

Stewart
 
If you don't have any records in your table, perhaps that's the problem. You might try putting a record in the table to start with and then seeing if the click event works. Otherwise I'd suggest you show us the code in the click event. Maybe there will be something which sticks out as a problem area. Dave Dardinger
 
Thanks Dave,

However, in the grid in the original container, this works OK. That is, when there are no records in the RecordSource table, the click event on the grid works fine.

In the subclassed container, I put a WAIT window in the grid click event, and this never comes up. It seems as if the grid isn't enabled or something like that. The click event just doesn't react.

Stewart
 
Have you tried playing with putting dodefault() after your code in the refresh and or the click events, just to see what happens? Otherwise all I can suggest is to a) post some code for us to look at, b) copy your code somewhere and start over either from your base classes or your subclass, c) disconnect your table / control source just to see if it makes a difference.

You've got to narrow down where the problem lies and doing silly things is sometimes the best thing to do just to gather data. Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top