custom gridviw column

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Please help, easily reproduced:

1. Create a class inheriting from
System.Windows.Forms.DataGridViewTextBoxColumn .
2. Add a simple property to that class (see below for the code I used).
3. Add a column of that type to a DataGridView.
4. Try to set the property you just created using the "Edit Columns" dialog
at design time.
5. Close and reopen the dialog. The value is gone!

Am i doing something wrong? Setting the value in code works.

Thanks for any help.



Here's the class i used:

Public Class MyColumn
Inherits System.Windows.Forms.DataGridViewTextBoxColumn

Private _MyProperty As String
<System.ComponentModel.Category("MyProperties")> _
Public Property MyProperty() As String
Get
Return _MyProperty
End Get
Set(ByVal value As String)
_MyProperty = value
End Set
End Property

End Class



.


Quantcast