custom gridviw column

  • Thread starter Louis-Pierre Dauphinais
  • Start date
L

Louis-Pierre Dauphinais

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
 
C

chip

I tried your sample and get the same results. It has to be something
simple that we are overlooking. Can someone who has solved this one
please help out?
 
C

chip

Louis,

To date I have not had any luck with this. I have read and tried a
number of options but nothing has worked. I thought it was as simple as
something not being wired correctly.
Have you had any luck with this.

Thanks,
Chip.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top