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!

mshflexgrid, restrict row selection

Status
Not open for further replies.

hansu

Programmer
Mar 12, 2002
89
I have a mshflexgrid which is bound to a hierarchical recordset. I want the enable the user to select rows of the parent recordset but not the rows of the child recordset. Can anybody show me a way to prevent the selection of the rows bound to the child recordset?

Thanks for your assistance.
 
Hi jlitondo

So far I have not been able to solve that problem.
 
Hansu, I out a way to make this work. I don't know how you have implemented data entry on your flex grid but on mine, I am using a floating text box to capture user input. Whenever a user initiates data entry on my grid, I pass focus from it to the floating text box. The sub procedure that passes control from the flex grid to the text box calls a boolean function that returns true if the current record is a child record. If a child record is selected, then I do not pass control from the flex grid to the floating text box for data entry and the data grid at that point remains read-only.
The way I know that a child record is in selection is that on my flex grid, only child records have a value in the last column of the grid. My boolean function tests for the existence of a value in this column every time a user initiates data entry on the grid.
I hope this fundamentally helps you. Let me know.

 
Thanks jlitondo for your tip. I don't use the mshflexgrid for data entry. The program performs some action based on data in the row selected by the user in the parent recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top