【发布时间】:2016-10-03 20:01:41
【问题描述】:
目前我一直在使用Devexpress Datagridview。所以我需要将下面的代码转换成它的 Devexpress Datagridview 等价物:
int id = e.RowIndex;
DataGridViewRow row = dgvproductMenu.Rows[id];
if (dgvproductMenu.Columns[e.ColumnIndex].Name == "Update")
{
product ObjP = new product
{
Product_id = row.Cells[2].Value.ToString(),
Name = row.Cells[3].Value.ToString(),
Description = row.Cells[4].Value.ToString(),
Price = Convert.ToDouble(row.Cells[5].Value),
Uom = row.Cells[6].Value.ToString(),
Quantity =Convert.ToInt32( row.Cells[7].Value.ToString()),
Tax = row.Cells[8].Value.ToString()
};
frmAddProduct fm = new frmAddProduct(ObjP);
fm.ShowDialog();
this.fillGrid();
我想使用 Devexpress 扩展 (gridview) 来实现。
【问题讨论】:
-
为什么不查看 devexpress 文档?
-
DataRow 行 = gdvInvoiceSummary.GetDataRow(gdvInvoiceSummary.GetSelectedRows()[0]); if (e.Button.Caption == "update") { invoiceSummary obj = new invoiceSummary { //CustomerName=row. }; frmAddinvoice fm = new frmAddinvoice(); fm.ShowDialog(); }
-
也许从获取和设置单元格值文档开始:documentation.devexpress.com/#windowsforms/CustomDocument753
标签: c# oop devexpress