简体   繁体   English

c# DevExpress 网格控件

[英]c# DevExpress GridControl

Good day, How can I implement it if I select some cell, and I want to pass it parameters to the dialog box.美好的一天,如果我 select 一些单元格,我该如何实现它,我想将它的参数传递给对话框。 but somehow it does not work on DevExpress, Here is the source code.但不知何故它在 DevExpress 上不起作用,这是源代码。 from the usual standard...从通常的标准...

private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
    {
        if (e.RowIndex >= 0)
        {
            DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
            new EditDrugs(row.Cells[0].Value.ToString()).ShowDialog();
        }
    }

Try: 尝试:

int[] selRows = ((GridView)gctNhapHang.MainView).GetSelectedRows();
DataRowView selRow = (DataRowView (((GridView)gctNhapHang.MainView).GetRow(selRows[0]));
string value = selRows["ColumnName"].ToString()

From what i can see you want to get the selected cell/cells value and convert it to use in a dialog据我所知,您想获取选定的单元格/单元格值并将其转换为在对话框中使用

foreach (int i in gridView1.GetSelectedRows())
                {
                    gridView1.GetSelectedCells(i);
                }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM