How do you prevent tablestyles from serializing in a custom DataGrid?

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a custom DataGrid called BasicDataGrid : DataGrid and I have an
internal variable that keeps track of the table styles, but this
internal variable keeps serializing!

Is there a way to prevent this object from serializing?

Thanks,
Dave
 
Is it a property? Make sure to Import System.ComponentModel then add the
following attributes to the property:

<Browsable(False),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
Public Property MyProperty() As SomeObject
..
..
..

HTH,
-B
 
Hello Beth, thanks for your reply!

Actually, it's not a property, that's part of the problem. I'm aware of
the Attribute you described and I use it all the time when I create
Properties.

In my situation, I have a private variable called m_tableStyle of type
DataGridTableStyle and in the constructor I add columns to this. This
is so that I can simply re-use custom data-specific datagrids in my
application...

The serialization only happens when I recompile this control and no
other time...

Thanks,
Dave
 
Back
Top