|
public
Form1()
{
InitializeComponent();
this.sfDataGrid1.CellRenderers["ComboBox"] = new
CustomComboBoxCellRenderer();
}
public class
CustomComboBoxCellRenderer : GridComboBoxCellRenderer
{
protected override void OnRender(Graphics paint, Rectangle cellRect, string
cellValue, CellStyleInfo style, DataColumnBase column,
Syncfusion.WinForms.GridCommon.ScrollAxis.RowColumnIndex rowColumnIndex)
{
base.OnRender(paint, cellRect, cellValue, style, column, rowColumnIndex);
var dropDownbuttonRect = new Rectangle(cellRect.X + cellRect.Width - 17,
cellRect.Y + (cellRect.Height / 2), 8, 4);
paint.DrawLine(new Pen(Color.Gray), dropDownbuttonRect.X,
dropDownbuttonRect.Y, dropDownbuttonRect.X + (dropDownbuttonRect.Width / 2),
dropDownbuttonRect.Y + dropDownbuttonRect.Height);
paint.DrawLine(new Pen(Color.Gray), dropDownbuttonRect.X +
dropDownbuttonRect.Width, dropDownbuttonRect.Y, dropDownbuttonRect.X +
(dropDownbuttonRect.Width / 2), dropDownbuttonRect.Y +
dropDownbuttonRect.Height);
}
}
|