From 94b872a684fa6c065b22d1cf7088243a0900353b Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 19 三月 2025 08:26:17 +0800
Subject: [PATCH] 异常
---
DevApp/Gs.DevApp/UserControl/SelectItemTbl.cs | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/SelectItemTbl.cs b/DevApp/Gs.DevApp/UserControl/SelectItemTbl.cs
index eb1e577..1b1dab5 100644
--- a/DevApp/Gs.DevApp/UserControl/SelectItemTbl.cs
+++ b/DevApp/Gs.DevApp/UserControl/SelectItemTbl.cs
@@ -32,15 +32,12 @@
btnIn.Click += (s, e) =>
{
var list = new List<string>();
- for (var i = 0; i < gridView1.DataRowCount; i++)
+ int[] rows = this.gridView1.GetSelectedRows();//鍏堣幏鍙栭�夋嫨琛岀殑琛屽彿
+ DataTable dt = this.gcMain.DataSource as DataTable;//寰楀埌GridControl鐨勬暟鎹簮
+ foreach (int idx in rows)
{
- var checkBox = gridView1.GetRowCellDisplayText(i, "gvChk");
- if (checkBox == "Checked")
- {
- var _guid = gridView1.GetRowCellValue(i, "dabGuid")
- .ToString();
- list.Add(_guid);
- }
+ string _guid = dt.Rows[idx]["dabGuid"].ToString();
+ list.Add(_guid);
}
UpdateParent?.Invoke(this,
new UpdateParentEventArgs { StringList = list });
--
Gitblit v1.9.3