UltraWebGrid 新增加行
//取出UltraWebGrid1的key()
ArrayList alItemId = new ArrayList();
RowsCollection row1 = UltraWebGrid1.DisplayLayout.Rows;
for (int i = 0; i < row1.Count; i++)
{
//PTK_PLAN_ITEM 捆 包 号
if (row1[i].Cells.FromKey("cust_bundle_no").Value != null)
alItemId.Add(row1[i].Cells.FromKey("cust_bundle_no").Value.ToString());
}
//DialogUltraWebGrid
SelectedRowsCollection rows = DialogUltraWebGrid.DisplayLayout.SelectedRows;
for (int i = 0; i < rows.Count; i++)
{
//添加不存在的记录
if (!alItemId.Contains(rows[i].Cells.FromKey("KBH").Value.ToString()))
{
UltraGridRow GridRow = new UltraGridRow();
//------------------------------------------------
GridRow = this.UltraWebGrid1.Rows.Band.AddNew();
GridRow.Cells.FromKey("cust_bundle_no").Value = rows[i].Cells.FromKey("kbh").Value.ToString(); //客户捆包号
GridRow.Cells.FromKey("bundle_no").Value = rows[i].Cells.FromKey("mjh").Value.ToString(); //母卷号
GridRow.Cells.FromKey("steel_num").Value = rows[i].Cells.FromKey("bs_gzmc").Value.ToString(); //母材钢种
GridRow.Cells.FromKey("net_qty").Value = rows[i].Cells.FromKey("jz").Value.ToString(); //母材净重
GridRow.Cells.FromKey("prod_pieces").Value = rows[i].Cells.FromKey("zs").Value.ToString(); //成品数量
}
}
ArrayList alItemId = new ArrayList();
RowsCollection row1 = UltraWebGrid1.DisplayLayout.Rows;
for (int i = 0; i < row1.Count; i++)
{
//PTK_PLAN_ITEM 捆 包 号
if (row1[i].Cells.FromKey("cust_bundle_no").Value != null)
alItemId.Add(row1[i].Cells.FromKey("cust_bundle_no").Value.ToString());
}
//DialogUltraWebGrid
SelectedRowsCollection rows = DialogUltraWebGrid.DisplayLayout.SelectedRows;
for (int i = 0; i < rows.Count; i++)
{
//添加不存在的记录
if (!alItemId.Contains(rows[i].Cells.FromKey("KBH").Value.ToString()))
{
UltraGridRow GridRow = new UltraGridRow();
//------------------------------------------------
GridRow = this.UltraWebGrid1.Rows.Band.AddNew();
GridRow.Cells.FromKey("cust_bundle_no").Value = rows[i].Cells.FromKey("kbh").Value.ToString(); //客户捆包号
GridRow.Cells.FromKey("bundle_no").Value = rows[i].Cells.FromKey("mjh").Value.ToString(); //母卷号
GridRow.Cells.FromKey("steel_num").Value = rows[i].Cells.FromKey("bs_gzmc").Value.ToString(); //母材钢种
GridRow.Cells.FromKey("net_qty").Value = rows[i].Cells.FromKey("jz").Value.ToString(); //母材净重
GridRow.Cells.FromKey("prod_pieces").Value = rows[i].Cells.FromKey("zs").Value.ToString(); //成品数量
}
}
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步