Imports Infragistics.Win
It is easy to specify the visual appearance of buttons in the WinGrid™ by setting the ButtonStyle property. The buttons affected by this property are those found in cells (both Button-style buttons and EditorButton-style buttons) and the buttons in the AddNew box. The ButtonStyle property is available on the Override objects exposed by the DisplayLayout and the Band objects. The ButtonStyle property is of type UIElementButtonStyle .
Before you start writing any code, you should place using/imports directives in your code-behind so you don’t need to always type out a member’s fully qualified name.
In Visual Basic:
Imports Infragistics.Win
In C#:
using Infragistics.Win;
Right-click on the WinGrid at design-time and select "UltraWinGrid Designer".
In the designer select the option called "Control Settings". Scroll down and expand the DisplayLayout property. Scroll down to the Override property and expand it, then inside the Override property scroll down to the ButtonStyle property.
You can also set this property on a Band’s Override by using the following code:
In Visual Basic:
Private Sub CustomersUltraGrid_InitializeLayout(ByVal sender As System.Object, _ ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) _ Handles CustomersUltraGrid.InitializeLayout Me.CustomersUltraGrid.DisplayLayout.Bands(0).Columns(0).Style = _ UltraWinGrid.ColumnStyle.Button Me.CustomersUltraGrid.DisplayLayout.Bands(0).Override.ButtonStyle = _ UIElementButtonStyle.Button3D End Sub
In C#:
private void customersUltraGrid_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { this.customersUltraGrid.DisplayLayout.Bands[0].Columns[0].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; this.customersUltraGrid.DisplayLayout.Bands[0].Override.ButtonStyle = UIElementButtonStyle.Button3D; }
The screen shot below shows the WinGrid using the 'Office2003ToolbarButton' style: