//DataTable 得到標題
//締友計算機技術有限公司 塗聚文
//foreach (DataColumn column in dt.Columns)
//{
// selectDt.Columns.Add(column.ColumnName, column.DataType);
//}
//DataTable 移動行 delete或 Remove 可以移除,但會出現問題 塗聚文注 20120808
//foreach (System.Data.DataRow rowIndex in removeRowIndex)
//{
// dt.Rows.Remove(rowIndex);
//}
//foreach (DataGridViewRow item in this.dataGridView1.SelectedRows)
//{
// dataGridView1.Rows.RemoveAt(item.Index);
//}
//DataGridView指定移除行
List<DataGridViewRow> removeRowIndex = new List<DataGridViewRow>();
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (!list.Contains(dataGridView1.Rows[i].Cells[0].Value.ToString()))
{
removeRowIndex.Add(dataGridView1.Rows[i]);
}
}
//DataGridView選擇移除
//foreach (DataGridViewRow row in dataGridView1.SelectedRows)
//{
// dataGridView1.Rows.Remove(row);
//}
foreach (DataGridViewRow dr in removeRowIndex)
{
dataGridView1.Rows.Remove(dr);
}
分享到:
相关推荐
小功能实现 DataGridView 添加自定列
Professional CSharp 4 and NET 4
CSharp in Depth - What you need to master CSharp 2 and 3.pdf
Packt.Mastering.Csharp.and.NET.Programming
使用c#语言对PLT文件进行了预览,包含了解析方法。
WPF Programmers Reference Windows Presentation Foundation with CSharp 2010 and NET 4 Feb 2010
文件大,分成2个部分,这是第2部分 CSharp 2010 and the dotNET 4 Platform 5th Edition 第1部分地址 http://download.csdn.net/source/2547240 第2部分地址 http://download.csdn.net/source/2547252
Data.Entry.and.Validation.with.CSharp.and.VB.Dot.NET.Windows.Forms
商业编程-源码-Csharp实例76 使用DataTable.zip
Prentice.Hall.Application Development Using Csharp And .Net.chm Build industrial-strength .NET applications with C#! <br> Practical, useful information on the .NET Framework, the Common ...
可以正常解压缩的Professional.ASP.NET.4.in.CSharp.and.VB
Wrox.Professional.ASP.NET.4.in.CSharp.and.VB.Mar.2010.rar
.net4平台与C#4.0高级编程 PRO_CSharp_And_DotNET_4_PlatForm
Wrox.Professional.Refactoring.in.CSharp.and.ASP.NET.Apr.2009.pdf
Wrox.Beginning.ASP.NET.4.5.1.in.Csharp.and.VB.Mar.2014
Wrox.Beginning.ASP.NET.4.5.in.Csharp.and.VB.Nov.2012.rar
Charles.River.Media.Cross-Platform.Web.Services.Using.CSharp.and.Java