Intersoft WebGrid Documentation
UseDefaultStyle Property
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : UseDefaultStyle Property






Specifies whether WebGrid should apply embedded default style for its appearance.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute("Specifies whether WebGrid should apply embedded default style for its appearance.")>
<ISNet.Serialization.XmlSerializableAttribute()>
<ISNet.Serialization.BinarySerializableAttribute()>
<DefaultValueAttribute()>
<CategoryAttribute("Appearance")>
<NotifyParentPropertyAttribute(True)>
Public Property UseDefaultStyle As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim value As Boolean
 
instance.UseDefaultStyle = value
 
value = instance.UseDefaultStyle
C# 
[DescriptionAttribute("Specifies whether WebGrid should apply embedded default style for its appearance.")]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[DefaultValueAttribute()]
[CategoryAttribute("Appearance")]
[NotifyParentPropertyAttribute(true)]
public bool UseDefaultStyle {get; set;}
Delphi 
public read-write property UseDefaultStyle: Boolean; 
JScript 
DescriptionAttribute("Specifies whether WebGrid should apply embedded default style for its appearance.")
ISNet.Serialization.XmlSerializableAttribute()
ISNet.Serialization.BinarySerializableAttribute()
DefaultValueAttribute()
CategoryAttribute("Appearance")
NotifyParentPropertyAttribute()
public function get,set UseDefaultStyle : boolean
Managed Extensions for C++ 
[DescriptionAttribute("Specifies whether WebGrid should apply embedded default style for its appearance.")]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[DefaultValueAttribute()]
[CategoryAttribute("Appearance")]
[NotifyParentPropertyAttribute(true)]
public: __property bool get_UseDefaultStyle();
public: __property void set_UseDefaultStyle( 
   bool value
);
C++/CLI 
[DescriptionAttribute("Specifies whether WebGrid should apply embedded default style for its appearance.")]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[DefaultValueAttribute()]
[CategoryAttribute("Appearance")]
[NotifyParentPropertyAttribute(true)]
public:
property bool UseDefaultStyle {
   bool get();
   void set (    bool value);
}

Remarks

The DefaultStyle feature in WebGrid will significantly reduce page output size, especially if you have large number of WebGrid in a webform. We recommend you to enable The default style feature since it offers the following benefits:

  • Clean control definition during development. This significantly improves loading time in the VS 2005 designer because unnecessary style objects do not need to be created.
  • Best performance in server throughput. Using default style will significantly reduce server side processing because there is no need for serializing styles, validating and parsing the styles and finally generate the styles into css-based classes in the page output.
  • When default style is enabled, in-line styles are no longer generated in the webpage. Instead, all WebGrid instances in the same webpage will share the same external stylesheet which significantly reducing output size.
  • Reduced page output size up to 70 percent. Based on a research, more than 60 percent of web developers do not modify the styles of Intersoft’s controls in their web application.

 Several important things to note around Default Style feature:

  • When Default Style is enabled, WebGrid will include a link to external stylesheet that contains reusable style definition used by the Default Style. This external resource is fetched by using standard WebResource feature, and is automatically handled by WebGrid. There is no efforts required by developers.
  • When Default Style is enabled, all styles definition in the control instance should be removed. You can’t have styles definition and using default style at the same time.
  • Default Style feature is enabled by default for new instance of WebGrid.NET Enterprise 5.0. Exisiting instances of WebGrid (i.e., after migrated from previous version) will continue to use their existing styles definition.

 

There are couple ways to enable DefaultStyle of WebGrid:

1. SmartTag Designer.
2. Property Set.

For further information on DefaultStyle you can read How-to: Enable Default Style for existing instance of WebGrid.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Reference

WebGrid Class
WebGrid Members

Concepts

Cleaner and reduced page output through built-in default style
Default Style Mode

Tasks

How-to: Enable Default Style for existing instance of WebGrid

©2012 Intersoft Solutions Corp. All Rights Reserved.