Infragistics(R) NetAdvantage(R) Windows Forms
ColumnStyle Enumeration
Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : ColumnStyle Enumeration

Enum used for specifying the UltraGridColumn.Style property.

Syntax

Visual Basic (Declaration) 
Public Enum ColumnStyle 
   Inherits System.Enum
C# 
public enum ColumnStyle : System.Enum 

Members

MemberDescription
Button Button style that has a button occupying the whole area of the cell. When the user clicks on the button ClickCellButton event is fired.
CheckBox Checkbox style that is not a tri-state checkbox.
Color Style that allows entering Colors.
CurrencyStyle that allows entering currency values. Note: This style uses the masking functionality. The CurrentCulture is used to determine the number of digits and decimal places. You can control the number of digits, decimal places etc... by setting the UltraGridColumn.MaskInput property. T:Infragistics.Win.EditorWithMask is used.
CurrencyNonNegativeSame as Currency except negative values aren't allowed.
CurrencyPositiveSame as Currency except zero and negative values aren't allowed.
DateStyle that allows entering dates. A drop down button is displayed that shows a drop down calendar. You can control the order of day, moth and year portions by setting the UltraGridColumn.MaskInput property. Minimum and maximum allowed values can be controlled using the UltraGridColumn.MinValue and UltraGridColumn.MaxValue properties. Note: This style uses the masking functionality.
DateTimeStyle that allows entering both date and time. Time uses short time pattern for the time porition. Also a drop down button is displayed that shows a drop down calendar. You can further control the format of the date and time by setting the UltraGridColumn.MaskInput property. Minimum and maximum allowed values can be controlled using the UltraGridColumn.MinValue and UltraGridColumn.MaxValue properties. Note: This style uses the masking functionality.
DateTimeWithoutDropDownSame as DateTime style except the drop down button is not displayed.
DateTimeWithSpinSame as DateTime style except the drop down button is not displayed and in its place spin buttons are displayed that can be used to increment or decrement each component of the date time.
DateWithoutDropDownSame as Date style except the drop down button is not displayed.
DateWithSpinSame as Date style except the drop down button is not displayed and in its place spin buttons are displayed that can be used to increment or decrement each component of the date.
Default Use the default style. Default style is based on the column's data type and other column property settings.
DoubleStyle that allows entering double values. Note: This style uses the masking functionality. The NumberFormatInfo of the CurrentCulture is used to determine the number of digits and decimal places. You can control the number of digits, decimal places etc... by setting the UltraGridColumn.MaskInput property. Minimum and maximum allowed values can be controlled using the UltraGridColumn.MinValue and UltraGridColumn.MaxValue properties. T:Infragistics.Win.EditorWithMask is used.
DoubleNonNegativeSame as Double except the user is not allowed to enter negative numbers. Note: This style uses the masking functionality.
DoubleNonNegativeWithSpinSame as DoubleNonNegative except this style shows spin buttons.
DoublePositiveSame as Double except the user is not allowed to enter zero or negative numbers. Note: This style uses the masking functionality.
DoublePositiveWithSpinSame as DoublePositive except this style shows spin buttons.
DoubleWithSpinSame as Double except this style shows spin buttons.
DropDownDrop down combobox style that has a text box and a small drop down button that users can click on to display a drop down list to select items from. You must set the UltraGridColumn.ValueList property to a list of items you want to display in the drop down. Without that this style will not have any effect.
DropDownCalendar Drop down calendar style that has a drop down arrow that users can click on to display a drop down calendar for selecting a date.
DropDownListDrop down list style that has a small drop down button that users can click on to display a drop down list from which they can select an item. You must set the UltraGridColumn.ValueList property to a list of items you want to display in the drop down. Without that this style will not have any effect.
DropDownValidateSame as DropDown style except that it will not allow the user to enter text in the combobox' edit box that does not match any one of the values in the value list. You must set the UltraGridColumn.ValueList property to a list of items you want to display in the drop down. Without that this style will not have any effect.
Edit Text box style.
EditButton Edit button style that has a text box as well as a button that users can click on.
FontStyle that lets the user select a font. T:Infragistics.Win.FontNameEditor is used
FormattedTextStyle that displays the column data as formatted text. This does not allow editing. T:Infragistics.Win.FormattedLinkLabel.FormattedLinkEditor is used.
FormattedTextEditorSame as FormattedText except that this allows editing as well. T:Infragistics.Win.FormattedLinkLabel.FormattedLinkEditor is used.
ImageStyle that uses the T:Infragistics.Win.EmbeddableImageRenderer to display images.
ImageWithShadowSame as Image style except the images are displayed shadowed.
IntegerStyle that allows entering integer (whole numbers) values. You can control the number of digits by setting the UltraGridColumn.MaskInput property. T:Infragistics.Win.EditorWithMask is used.
IntegerNonNegativeSame as Integer except the user is not allowed to enter negative numbers.
IntegerNonNegativeWithSpinSame as IntegerNonNegative except this style shows spin buttons.
IntegerPositiveSame as Integer except the user is not allowed to enter zero or negative numbers.
IntegerPositiveWithSpinSame as IntegerPositive except this style shows spin buttons.
IntegerWithSpinSame as Integer except this style shows spin buttons.
TimeStyle that allows entering time. This uses the short time pattern of the current culture. You can control various aspects of the time format by setting the UltraGridColumn.MaskInput property. Minimum and maximum allowed values can be controlled using the UltraGridColumn.MinValue and UltraGridColumn.MaxValue properties. Note: This style uses the masking functionality.
TimeWithSpinSame as Time style except spin buttons are displayed that can be used to increment or decrement each component of the time.
TimeZoneStyle that lets the user select time zone. T:Infragistics.Win.TimeZoneEditor is used.
TrackBar Style which displays the column as a TrackBar.
TriStateCheckBox Tri-state checkbox style.
URLStyle that displays the column data as a URL. T:Infragistics.Win.FormattedLinkLabel.FormattedLinkEditor is used.

Example

Following code illustrates how to create a ValueList and assign it to a column. A ValueList maps data values to text. Depending on the value assigned to Style property of the column, cells in the column act like drop down lists or combo drop downs.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button9_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button9.Click

      ' If the value list has already been created, then return since we
      ' don't want to recreate it again.
      If Me.ultraGrid1.DisplayLayout.ValueLists.Exists("VL1") Then Return

      ' Create a value list with the key of VL1.
      Dim valueList As valueList = Me.ultraGrid1.DisplayLayout.ValueLists.Add("VL1")

      ' Add some items to it. Here the items added have numeric data values and
      ' associated display texts. What the user sees in the cells is the display 
      ' text for these underlying numeric data value. Also when the user modifies
      ' a cell and selects one of the item, what goes in the data source is the
      ' associated numeric value.
      valueList.ValueListItems.Add(1, "One")
      valueList.ValueListItems.Add(2, "Two")
      valueList.ValueListItems.Add(3, "Three")
      valueList.ValueListItems.Add(4, "Four")
      valueList.ValueListItems.Add(5, "Five")

      ' Get the column you want to use the value list in.
      Dim column As UltraGridColumn = Me.ultraGrid1.DisplayLayout.Bands(0).Columns(0)

      ' Now assign the value list to that column.
      column.ValueList = valueList

      ' Optionally set the style of that column to an appropriate drop down style.
      ' DropDownValidate style ensures that the user enters only the values found 
      ' in the value list. 
      column.Style = ColumnStyle.DropDownValidate

      ' When AutoEdit is turned on on a column with value list assigned to it, the
      ' UltraGrid auto-completes the text in the cell as the user types to a matching
      ' item in the value list. This is enabled by default, however you can turn it
      ' off by setting AutoEdit to false.
      column.AutoEdit = False

  End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button9_Click(object sender, System.EventArgs e)
{		
	
	// If the value list has already been created, then return since we
	// don't want to recreate it again.
	if ( this.ultraGrid1.DisplayLayout.ValueLists.Exists( "VL1" ) )
		return;

	// Create a value list with the key of VL1.
	ValueList valueList = this.ultraGrid1.DisplayLayout.ValueLists.Add( "VL1" );
	
	// Add some items to it. Here the items added have numeric data values and
	// associated display texts. What the user sees in the cells is the display 
	// text for these underlying numeric data value. Also when the user modifies
	// a cell and selects one of the item, what goes in the data source is the
	// associated numeric value.
	valueList.ValueListItems.Add( 1, "One" );
	valueList.ValueListItems.Add( 2, "Two" );
	valueList.ValueListItems.Add( 3, "Three" );
	valueList.ValueListItems.Add( 4, "Four" );
	valueList.ValueListItems.Add( 5, "Five" );

	// Get the column you want to use the value list in.
	UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns[0];

	// Now assign the value list to that column.
	column.ValueList = valueList;
	
	// Optionally set the style of that column to an appropriate drop down style.
	// DropDownValidate style ensures that the user enters only the values found 
	// in the value list. 
	column.Style = ColumnStyle.DropDownValidate;

	// When AutoEdit is turned on on a column with value list assigned to it, the
	// UltraGrid auto-completes the text in the cell as the user types to a matching
	// item in the value list. This is enabled by default, however you can turn it
	// off by setting AutoEdit to false.
	column.AutoEdit = false;

}

Remarks

This property is for convenience. It lets you set the edit style of a column to one of the commonly used edit styles. This list does not include all the styles that are available. If a style is not listed in this enum then you can use the UltraGridColumn.Editor property along with other properties that the UltraGridColumn object exposes, like UltraGridColumn.MinValue, UltraGridColumn.MaxValue, UltraGridColumn.MinValueExclusive, UltraGridColumn.MaxValueExclusive, UltraGridColumn.MaskInput, UltraGridColumn.FormatInfo, UltraGridColumn.Format, UltraGridColumn.MaxLength, UltraGridColumn.RegexPattern etc... to accomplish the desired column style. As a matter of fact some the styles set some of the these properties to accomplish the desired behavior. For example the CurrencyPositive style sets the UltraGridColumn.Editor to T:Infragistics.Win.EditorWithMask instance and the UltraGridColumn.MinValueExclusive to 0. Also you can set these properties to further refine the behavior of a column style. This is because these properties take precedence over the Style property.

See Also