话不多说,先上效果图
对于第一列的效果是如何实现的就不多说了,网上有很多例子
重点是第三列的效果实现方法,代码如下
private void GridSet()
{
//DevExpress.XtraEditors.Controls.EditorButton editorBtn = new EditorButton();
//editorBtn.Kind = ButtonPredefines.Glyph;
//editorBtn.Image = Image.FromFile("u56558.png"); DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit btnEdit = new RepositoryItemButtonEdit();
btnEdit.Buttons[0].Kind = ButtonPredefines.Glyph;
btnEdit.Buttons[0].Image = Image.FromFile("u56558.png");
btnEdit.ButtonsStyle = BorderStyles.UltraFlat;
btnEdit.TextEditStyle = TextEditStyles.DisableTextEditor; bandedGridColumn3.ColumnEdit = btnEdit; bandedGridColumn3.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways; btnEdit.ButtonClick += (s, e) =>
{
MessageBox.Show("oh!yes");
};
}