From 7d43ccf3c00d034c2072a9d45af9b96171310854 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 14 三月 2025 15:24:06 +0800 Subject: [PATCH] 提交 --- DevApp/Gs.DevApp/UserControl/SelectCgMx.cs | 14 ++++++-------- DevApp/Gs.DevApp/UserControl/SelectCgMx.Designer.cs | 19 ++++--------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/SelectCgMx.Designer.cs b/DevApp/Gs.DevApp/UserControl/SelectCgMx.Designer.cs index 58ecc10..50c0fef 100644 --- a/DevApp/Gs.DevApp/UserControl/SelectCgMx.Designer.cs +++ b/DevApp/Gs.DevApp/UserControl/SelectCgMx.Designer.cs @@ -32,7 +32,6 @@ this.panelControl2 = new DevExpress.XtraEditors.PanelControl(); this.gcMain = new DevExpress.XtraGrid.GridControl(); this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); - this.gv_chk = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_guid = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_ebelnK3id = new DevExpress.XtraGrid.Columns.GridColumn(); this.gv_billNo = new DevExpress.XtraGrid.Columns.GridColumn(); @@ -98,7 +97,6 @@ this.gridView1.Appearance.Row.Options.UseFont = true; this.gridView1.ColumnPanelRowHeight = 50; this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { - this.gv_chk, this.gv_guid, this.gv_ebelnK3id, this.gv_billNo, @@ -120,20 +118,12 @@ this.gridView1.IndicatorWidth = 50; this.gridView1.Name = "gridView1"; this.gridView1.OptionsFind.ShowSearchNavButtons = false; + this.gridView1.OptionsSelection.CheckBoxSelectorColumnWidth = 60; + this.gridView1.OptionsSelection.MultiSelect = true; + this.gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect; + this.gridView1.OptionsSelection.ShowCheckBoxSelectorInColumnHeader = DevExpress.Utils.DefaultBoolean.True; this.gridView1.OptionsView.ShowAutoFilterRow = true; this.gridView1.OptionsView.ShowGroupPanel = false; - // - // gv_chk - // - this.gv_chk.Caption = "閫夋嫨"; - this.gv_chk.FieldName = "gvChk"; - this.gv_chk.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left; - this.gv_chk.MaxWidth = 50; - this.gv_chk.MinWidth = 50; - this.gv_chk.Name = "gv_chk"; - this.gv_chk.Visible = true; - this.gv_chk.VisibleIndex = 0; - this.gv_chk.Width = 50; // // gv_guid // @@ -442,7 +432,6 @@ private DevExpress.XtraEditors.PanelControl panelControl2; private DevExpress.XtraGrid.GridControl gcMain; private DevExpress.XtraGrid.Views.Grid.GridView gridView1; - private DevExpress.XtraGrid.Columns.GridColumn gv_chk; private DevExpress.XtraGrid.Columns.GridColumn gv_guid; private DevExpress.XtraGrid.Columns.GridColumn gv_ebelnK3id; private DevExpress.XtraGrid.Columns.GridColumn gv_billNo; diff --git a/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs b/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs index ddbc91e..674d107 100644 --- a/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs +++ b/DevApp/Gs.DevApp/UserControl/SelectCgMx.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using System.Data; using System.Text; using System.Windows.Forms; using DevExpress.Utils.DirectXPaint; @@ -39,15 +40,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, "guid") - .ToString(); - list.Add(_guid); - } + string _guid= dt.Rows[idx]["guid"].ToString(); + list.Add(_guid); } UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringList = list }); -- Gitblit v1.9.3