Infragistics UltraWinGrid useful tips
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 Columns
In 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/appeacence
In grid InitializeLayout event handler, use
e.Layout.Bands(0).Columns("ButtonCell").CellButtonAppearance
Disable Column Sorting
In grid InitializeLayout event handler, set
with e.Layout
.Override.HeaderClickAction = HeaderClickAction.Select
.Override.SelectTypeCol = SelectType.None
End With
To enable immediate scrolling
In grid InitializeLayout event handler, set
with e.Layout
.ScrollBounds = ScrollBounds.ScrollToFill
.ScrollStyle = ScrollStyle.Immediate
End With
Update datasource for each cell change
In grid InitializeLayout event handler, set
UltraGrid1.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChange
To change grid Header Appearance
In grid InitializeLayout event handler, use
UltraGrid1.DisplayLayout.Bands(0).Override.HeaderAppearance property
To disable column swapping, moving,sizing and GroupBy
In 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 line
In 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 cell
In grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Override.CellClickAction = CellClickAction.RowSelect
End With
Hide a column
In grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns("ColumnName").Hidden = True
End With
Adding DropDownList column
In 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 column
In 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 line
In 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 text
In grid InitializeLayout event handler, set
With UltraGrid1.DisplayLayout.Bands(0).
.Columns(0).Header.Caption = "My header"
End With
To change date column format
In 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 cell
In 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 column
In 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 header
In 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 data
ultraGrid1.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
16 Comments:
Very cool and useful tips!
nice tips.and thnx..
The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
AWS Training in Bangalore
AWS training in sholinganallur
AWS training in Tambaram
AWS training in Velachery
This comment has been removed by the author.
This comment has been removed by the author.
This comment has been removed by the author.
This comment has been removed by the author.
This comment has been removed by the author.
This comment has been removed by the author.
Such an excellent and interesting blog, do post like this more with more information, this was very useful. Salesforce Training India
This comment has been removed by the author.
This comment has been removed by the author.
This comment has been removed by the author.
Great post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
CRS Info Solutions Salesforce training for beginners
.I simply wanted to thank you so much again. I am not sure the things that I might have gone through without the type of hints revealed by you regarding that situation.
oracle training in chennai
oracle training in velachery
oracle dba training in chennai
oracle dba training in velachery
ccna training in chennai
ccna training in velachery
seo training in chennai
seo training in velachery
.I simply wanted to thank you so much again. I am not sure the things that I might have gone through without the type of hints revealed by you regarding that situation.
oracle training in chennai
oracle training in velachery
oracle dba training in chennai
oracle dba training in velachery
ccna training in chennai
ccna training in velachery
seo training in chennai
seo training in velachery
Post a Comment
Subscribe to Post Comments [Atom]
<< Home