数据库连接配置也在bin config.xml
YcwGzSystem.rar
(276.37 KB)
private void CustomerDgv() { dgv1.AlternatingRowsDefaultCellStyle.BackColor = SystemColors.InactiveCaptionText; dgv1.MultiSelect =true; dgv1.SelectionMode = DataGridViewSelectionMode.CellSelect; //要自己添加列这个属性要为true // dgv1.VirtualMode = true; 不要这一句代码 DataGridViewCheckBoxColumn colISselect = new DataGridViewCheckBoxColumn(); colISselect.HeaderText = "状态"; colISselect.Name = "状态"; // colISselect.ReadOnly = false; dgv1.Columns.Add(colISselect); DataGridViewTextBoxColumn colgz = new DataGridViewTextBoxColumn(); colgz.DataPropertyName = "工种名称"; colgz.HeaderText = "工种"; colgz.ValueType=typeof(string); dgv1.Columns.Add(colgz); DataGridViewComboBoxColumn colGz = new DataGridViewComboBoxColumn(); colGz.DataPropertyName = "业绩算法"; colGz.DataSource = service.Get_yjsf().Tables[0]; colGz.DisplayMember = "方法名称"; colGz.ValueMember = "方法名称"; colGz.HeaderText = "业绩计算方法"; colGz.ReadOnly = false; dgv1.Columns.Add(colGz); }