Datagridview的FullRowSelect功能在此代码起作用后不起作用。正在选择单个单元格。
private void CaO()
{
System.Data.DataTable tbl = new System.Data.DataTable();
new OleDbDataAdapter("SELECT * FROM [Sayfa1$]",
@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\ikinciexcel.xlsx; Extended Properties='Excel 12.0 xml;HDR=YES;'").Fill(tbl);
System.Data.DataTable dtCloned = tbl.Clone();
dtCloned.Columns[1].DataType = typeof(float);
foreach (DataRow row in tbl.Rows)
{
dtCloned.ImportRow(row);
}
var f = new Form();
var dgv = new DataGridView { DataSource = dtCloned, Dock = DockStyle.Fill };
dtCloned.DefaultView.RowFilter = "CaO >= 1 and CaO <= 11";
dataGridView2.Controls.Add(dgv);
}
答案 0 :(得分:0)
您需要设置SelectionMode
属性
var dgv = new DataGridView {
DataSource = dtCloned,
Dock = DockStyle.Fill,
SelectionMode = DataGridViewSelectionMode.FullRowSelect;
};
答案 1 :(得分:0)
如您所说,只有selected
是Datagridview
。来自Datagridview
首先将multiselect
选择属性true
设置为code
您也可以像这样通过dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.MultiSelect = True;
进行操作
Datagridview
然后您只需选择所有private void selectButton_Click(object sender, EventArgs e)
{
dataGridView1.SelectAll();
}
之类的
import {get} from Lodash
var x=get(item,path.join("."))