J
Jon F
I'd like to create a UserControl that consists of a DataGridView and a
couple of other things such as e.g. a button for resetting a filter.
The desired result would be to be able to use the UserControl just as a
DataGridView, i.e. without the need for the UserControl to publish the grid
by means of a property, but I can't seem to find a way to do that. If I'd
have to rather inherit from DataGridView I wouldn't know how to then add
other controls to it.
I thus created a public property "GridControl" that allows setting the
grid's properties when the UserControl is being used on a form. However,
when I attempt to access the columns collection I get a "Object reference
not set to an instance of an object." exception. While I can access the
columns collection by code, I'd prefer to be able to set them at design
time.
What would be the best approach for this?
Regards,
J.
couple of other things such as e.g. a button for resetting a filter.
The desired result would be to be able to use the UserControl just as a
DataGridView, i.e. without the need for the UserControl to publish the grid
by means of a property, but I can't seem to find a way to do that. If I'd
have to rather inherit from DataGridView I wouldn't know how to then add
other controls to it.
I thus created a public property "GridControl" that allows setting the
grid's properties when the UserControl is being used on a form. However,
when I attempt to access the columns collection I get a "Object reference
not set to an instance of an object." exception. While I can access the
columns collection by code, I'd prefer to be able to set them at design
time.
What would be the best approach for this?
Regards,
J.