是否可以使用DEVEXPRESS在Gridview单元中添加多个

是否可以使用DEVEXPRESS在Gridview单元中添加多个

本文介绍了是否可以使用DEVEXPRESS在Gridview单元中添加多个存储库项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数据表,我必须在同一个单元格中添加两个存储库项

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;
    }

我必须添加Button和Combobox是否可能.

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..

推荐答案

您不能同时激活两个RepositoryItem.您可以使用ComboBox RepositoryItem并在Buttons属性中添加一个附加按钮.然后,您可以对ButtonClick或ButtonPressed事件做出反应.

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.

这篇关于是否可以使用DEVEXPRESS在Gridview单元中添加多个存储库项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 09:41