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

Grid Column Resize Event 1

Status
Not open for further replies.

paulhuts

Programmer
Jan 7, 2001
14
NZ
Unable to get this event to trigger on any of my grid columns.

Need to store column widths after column resize.

Many thanks

 
Hi!

Make sure your grid is not reconstructed in run-time. VFP makes columns reconstructuon in run-time in several cases that cause lose of all properties and code difines inside of the columns, headers and controls.

I solved this problem by making my own header class. When user makes any change of the column, header's Click event fires. Thus I trap it, and track column size and column order change (I store old width and order in the my header class properties). THan fire appropriate method of grid where developers that use my grid class can define code for any column resize or move. No need to put code in the column.

Than, you can add new header class programmatically to the grid columns - and here you are.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
I am indeed reconstucting the grid at run- time.

I had resorted to the 'brute force' approach of scanning the grid columns, re-populating the column widths array before a change was likely and then re-contructing after the change.

It works but is not as elegant as your solution. I definitely look into creating a header class.

Thanks for your reply.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top