Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating Custom DataGridView Column from Custom Control
Message
General information
Forum:
ASP.NET
Category:
Class design
Title:
Creating Custom DataGridView Column from Custom Control
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01200366
Message ID:
01200366
Views:
63
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
Reply
Map
View

Click here to load this message in the networking platform