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






Gets or sets a value indicating whether all displayed columns's width should be fitted to grid.

Syntax

Visual Basic (Declaration) 
<DefaultValueAttribute()>
<NotifyParentPropertyAttribute(True)>
<DescriptionAttribute("Gets or sets a value indicating whether all displayed columns's width should be fitted to grid.")>
<ISNet.Serialization.XmlSerializableAttribute()>
<ISNet.Serialization.BinarySerializableAttribute()>
Public Property AutoFitColumns As Boolean
Visual Basic (Usage)Copy Code
Dim instance As LayoutSet
Dim value As Boolean
 
instance.AutoFitColumns = value
 
value = instance.AutoFitColumns
C# 
[DefaultValueAttribute()]
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Gets or sets a value indicating whether all displayed columns's width should be fitted to grid.")]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
public bool AutoFitColumns {get; set;}
Delphi 
public read-write property AutoFitColumns: Boolean; 
JScript 
DefaultValueAttribute()
NotifyParentPropertyAttribute()
DescriptionAttribute("Gets or sets a value indicating whether all displayed columns's width should be fitted to grid.")
ISNet.Serialization.XmlSerializableAttribute()
ISNet.Serialization.BinarySerializableAttribute()
public function get,set AutoFitColumns : boolean
Managed Extensions for C++ 
[DefaultValueAttribute()]
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Gets or sets a value indicating whether all displayed columns's width should be fitted to grid.")]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
public: __property bool get_AutoFitColumns();
public: __property void set_AutoFitColumns( 
   bool value
);
C++/CLI 
[DefaultValueAttribute()]
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Gets or sets a value indicating whether all displayed columns's width should be fitted to grid.")]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
public:
property bool AutoFitColumns {
   bool get();
   void set (    bool value);
}

Remarks

AutoFitColumns work in 2 modes:

  1. Proportional width mode. In this mode, all columns' width will be calculated proportionally to fit into the grid. This mode will be used by default when no AutoWidth column is specified.
  2. AutoWidth column mode. In this mode, only the column which IsAutoWidth set to true will be expanded or shrinked to fit into the grid. Other columns' width will be leave unmodified. However, when the width of the AutoWidth column is less than the number specified in AutoColMinWidth, the AutoWidth Column will be set to AutoColMinWidth and other columns' width will be calculated proportionally in order to fit into grid. 

For more information you can read Automatic Columns Fitting.  

Keep in mind that Column Freezing feature should not be used with AutoFitColumns feature due to purpose’s conflict. AutoFitColumns feature purpose is to prevent horizontal scrolling by auto-fitting all columns, while Column Freezing feature requires horizontal scrolling. You can enable AutoFitColumns at child table level so that the columns fit into the main Grid's viewport. Arrange the child table layout so they are always inside the Grid's boundary to keep all columns visible.

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

©2012 Intersoft Solutions Corp. All Rights Reserved.