问题
I have Datatable and I have to add Two repository items to same cell
DataTable dtbl = null;
public Form1()
{
InitializeComponent();
dtbl = new DataTable();
dtbl.Columns.Add("T1");
dtbl.Columns.Add("T2");
dtbl.Columns.Add("T3");
dtbl.Rows.Add("Test1", "Test2", "Test3");
dtbl.Rows.Add("Test4", "Test5", "Test6");
dtbl.Rows.Add("Test7", "Test8", "Test9");
gridControl1.DataSource = dtbl.DefaultView;
gridView1.CustomRowCellEdit += new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(gridView1_CustomRowCellEdit);
}
void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
{
RepositoryItemButtonEdit rebBtn = new RepositoryItemButtonEdit();
RepositoryItemComboBox rebcmb= new RepositoryItemComboBox();
rebBtn.AutoHeight = false;
rebcmb.AutoHeight = false;
e.RepositoryItem = rebBtn;
e.RepositoryItem = rebcmb;
}
I have to add Button and Combobox is it Possible .
The image i uploaded is a WPF gridColumn , is this possible in DEVEXPRESS GridControl
This is Devexpress Gridcontrol .. here i created Two sepetate columns..
回答1:
You can't have two RepositoryItems active at the same time. You could use a ComboBox RepositoryItem and add an additional button to the Buttons property though. You could then react to the ButtonClick or ButtonPressed events.
来源:https://stackoverflow.com/questions/15333442/is-it-possible-to-add-multiple-repository-items-in-a-gridview-cells-using-devexp