Ok, I previously found code that showed how to create a custom DataGridView Column based off of a DateTimePicker, which worked great. Now, I have created a custom control since then, a FontPicker. I am looking to do the same thing by created a custom DataGridView column based on the FontPicker I created. I tried to copy the class that worked for the DateTimePicker, but I seem to have a problem with the Implements portion. Although the IDE and the Compiler both do not claim that my code has any errors, but when it runs, some events do not seem to be firing properly. At the moment, the problem I have is (what appears to be) the Property EditingControlDataGridView. According to what I read, this property is supposed to automatically be supplied the DataGridView object reference when you .Add() the column to the grid. Apparently that is not the case for my custom control. I know this because the very first time I click in a cell that uses my custom column, I crash with a NullReferenceException from the OnValueChanged() routine claiming that the .EditingControlDataGridView property is = Nothing.
Does anyone know how I can get my custom control to work as a column properly in the DGV?
________________________
Ben Santiago, MCP & A+
Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS)
Eastern Suffolk BOCES - Student Data Services
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rich Cook