Is It Possible to Add Multiple Repository Items in a Gridview Cells using DEVEXPRESS?

为君一笑 提交于 2019-12-11 16:33:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!