Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 15 Apr 2005 18:58 GMT
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
Beth Massi [Architect MVP] - 18 Apr 2005 17:13 GMT
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

>I have a custom DataGrid called BasicDataGrid : DataGrid and I have an
> internal variable that keeps track of the table styles, but this
[quoted text clipped - 4 lines]
> Thanks,
> Dave
Dave - 20 Apr 2005 18:30 GMT
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
Beth Massi [Architect MVP] - 26 Apr 2005 23:21 GMT
Dave, would you mind posting some code?

> Hello Beth, thanks for your reply!
>
[quoted text clipped - 12 lines]
> Thanks,
> Dave

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.