Hide group header box:In grid InitializeLayout event handler, set
e.Layout.GroupByBox.Hidden = True
Hide row selectors:In grid InitializeLayout event handler, set
e.Layout.Override.RowSelectors = DefaultableBoolean.False
Selecting single row:In grid InitializeLayout event handler, set
e.Layout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Single
Fixed ColumnsIn grid InitializeLayout event handler, set
e.Layout.UseFixedHeaders = true;
UltraGrid.Bands[0].Columns[0].Header.Fixed = true;
UltraGrid.Bands[0].Columns[1].Header.Fixed = true;
Change cell button properties/appeacenceIn grid InitializeLayout event handler, use
e.Layout.Bands(0).Columns("ButtonCell").CellButtonAppearance
Disable Column SortingIn grid InitializeLayout event handler, set
with e.Layout
.Override.HeaderClickAction = HeaderClickAction.Select
.Override.SelectTypeCol = SelectType.None
End With
To enable immediate scrollingIn grid InitializeLayout event handler, set
with e.Layout
.ScrollBounds = ScrollBounds.ScrollToFill
.ScrollStyle = ScrollStyle.Immediate
End With
Update datasource for each cell changeIn grid InitializeLayout event handler, set
UltraGrid1.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChange
To change grid Header AppearanceIn grid InitializeLayout event handler, use
UltraGrid1.DisplayLayout.Bands(0).Override.HeaderAppearance property
To disable column swapping, moving,sizing and GroupByIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Override.AllowColMoving = AllowColMoving.NotAllowed
.Override.AllowColSwapping = AllowColSwapping.NotAllowed
.Override.AllowColSizing = AllowColSizing.None
.Override.AllowGroupBy = DefaultableBoolean.False
End With
Show header text in multi lineIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Override.WrapHeaderText = DefaultableBoolean.False
.ColHeaderLines = 2 'two lines
.Columns(0).Header.Caption = "text1" & Environment.NewLine & "text2"
End With
To select a full row if click on any cellIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Override.CellClickAction = CellClickAction.RowSelect
End With
Hide a columnIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns("ColumnName").Hidden = True
End With
Adding DropDownList columnIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns("ColumnName").Style = ColumnStyle.DropDownList
.Columns("ColumnName").ValueList = UltraGrid1.DisplayLayout.ValueLists("sample")
End With
' create UltraWinGrid Value List
UltraGrid1.DisplayLayout.ValueLists.Add("sample")
With UltraGrid1.DisplayLayout.ValueLists("sample").ValueListItems
Dim aVLI As New ValueListItem()
aVLI.DataValue = 1
aVLI.DisplayText = "Item 1"
.Add(aVLI)
aVLI = New ValueListItem()
aVLI.DataValue = 2
aVLI.DisplayText = "Item 2"
.Add(aVLI)
aVLI = New ValueListItem()
aVLI.DataValue = 3
aVLI.DisplayText = "Item 3"
.Add(aVLI)
End With
Adding a button columnIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).Style = ColumnStyle.Button
.Columns(0).ButtonDisplayStyle = UltraWinGrid.ButtonDisplayStyle.Always
End With
To make cell text multi lineIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).CellMultiLine = DefaultableBoolean.True
End With
UltraGrid1.DisplayLayout.Bands(0).Columns(0).VertScrollBar = True
You may want to increase the default row height of the grid to better illustrate this sample.
UltraGrid1.DisplayLayout.Override.DefaultRowHeight = 800
To change column header textIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).Header.Caption = "My header"
End With
To change date column formatIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).Format = "dd/mm/yyyy hh:mm:ss"
End With
Adding an image to a cellIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).CellButtonAppearance.Image = My.Resources.ImageName 'Add an image to resource file to access from My.Resources
End With
To make Editable/Non Editable columnIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).CellActivation = Activation.AllowEdit ' to allow edit
.Columns(0).CellActivation = Activation.NoEdit ' to lock the cell
End With
To add a band headerIn grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.HeaderVisible = True
.Header.Caption = "My Header"
.Header.Appearance.TextHAlign = HAlign.Center
End With
To reset the sorted columns when unloading then reloading your dataultraGrid1.DisplayLayout.Bands[0].SortedColumns.Clear()
Do not show Expansion Indicator when there are no child items/band In grid InitializeLayout event handler, set
UltraGrid1.DisplayLayout.Bands(0).Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay
Labels: Cell, Column, Fixed, Header, Hide, Row, Scroll, Sort, UltraWinGrid