// Please use the following namespace
// using System.Windows.Forms;
// using System.Drawing;
// using GrapeCity.Win.Editors;
public void SetListColumns()
{
// Creates the GcComboBox
GcComboBox gcComboBox1 = new GcComboBox();
// Sets the DefaultListItem settings.
gcComboBox1.ListDefaultColumn.AutoWidth = true;
gcComboBox1.ListDefaultColumn.Header.ContentAlignment = ContentAlignment.MiddleCenter;
// Creates a GradientEffect object.
GradientEffect gradienteffect = new GradientEffect();
gradienteffect.Direction = GradientDirection.Side;
gradienteffect.EndColor = Color.FromArgb(224, 224, 224);
gcComboBox1.ListDefaultColumn.Header.GradientEffect = gradienteffect;
gcComboBox1.ListDefaultColumn.Header.TextEffect = TextEffect.RaisedLite;
gcComboBox1.ListDefaultColumn.DefaultSubItem.ContentAlignment = ContentAlignment.MiddleCenter;
gcComboBox1.ListDefaultColumn.DefaultSubItem.Padding = new Padding(2, 2, 2, 2);
gcComboBox1.ListDefaultColumn.DefaultSubItem.WordWrap = false;
// The column1 and the column2 inherits the settings of the DefaultListColumn
ListColumn column1 = new ListColumn();
ListColumn column2 = new ListColumn();
// The column3 overwrites some properties for advanced settings.
ListColumn column3 = new ListColumn();
column3.AutoWidth = false;
column3.DataDisplayType = DataDisplayType.Image;
column3.Header.AllowResize = true;
column3.Header.Clickable = true;
column3.Header.Image = new Bitmap(@"C:\ColumnHeader.jpg");
column3.Header.TextAttachAlignment = AttachAlignment.RightMiddle;
gcComboBox1.ListColumns.AddRange(new ListColumn[] { column1, column2, column3 });
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports System.Drawing;
' Imports GrapeCity.Win.Editors;
Public Sub SetListColumns()
' Creates the GcComboBox
Dim gcComboBox1 As New GcComboBox()
' Sets the DefaultListItem settings.
gcComboBox1.ListDefaultColumn.AutoWidth = True
gcComboBox1.ListDefaultColumn.Header.ContentAlignment = ContentAlignment.MiddleCenter
' Creates a GradientEffect object.
Dim gradienteffect As New GradientEffect()
gradienteffect.Direction = GradientDirection.Side
gradienteffect.EndColor = Color.FromArgb(224, 224, 224)
gcComboBox1.ListDefaultColumn.Header.GradientEffect = gradienteffect
gcComboBox1.ListDefaultColumn.Header.TextEffect = TextEffect.RaisedLite
gcComboBox1.ListDefaultColumn.DefaultSubItem.ContentAlignment = ContentAlignment.MiddleCenter
gcComboBox1.ListDefaultColumn.DefaultSubItem.Padding = New Padding(2, 2, 2, 2)
gcComboBox1.ListDefaultColumn.DefaultSubItem.WordWrap = False
' The column1 and the column2 inherits the settings of the DefaultListColumn
Dim column1 As New ListColumn()
Dim column2 As New ListColumn()
' The column3 overwrites some properties for advanced settings.
Dim column3 As New ListColumn()
column3.AutoWidth = False
column3.DataDisplayType = DataDisplayType.Image
column3.Header.AllowResize = True
column3.Header.Clickable = True
column3.Header.Image = New Bitmap("C:\ColumnHeader.jpg")
column3.Header.TextAttachAlignment = AttachAlignment.RightMiddle
gcComboBox1.ListColumns.AddRange(New ListColumn() {column1, column2, column3})
End Sub