datagridview 点击标头排序, 隐藏行会显示出来,如何只排序 只显示的行?
解决方案 »
- DataGridView中的ComboBox的列绑定出错
- TreeNode.Tag是干什么用的?一般在什么情况下用?
- 出现错误:用户 'sa' 登录失败。原因: 未与信任 SQL Server 连接相关联。
- 火急*****关于引用dll!*******!解决马上给分!!!!
- webform ,C#写,把txt文件下载本地并保存
- 如何获取ie窗口的内容 c#
- C#写一个小程序,点击一个按钮,从txt读出一个关键字,在从excel中查找这个关键字同行的一些数据。
- 添加记录报错,请高手指教
- ◎如何得知所有子线程都已结束??高手请进!◎
- 请问:在WindowsApplication中如何使用DataGrid并将一个DataView绑定到DataGrid中
- 取网页源码,卡住~
- 捕捉到COMException:集合所要求的成员不存在
{
var data = new DataTable();
data.Columns.Add("column1", typeof(string));
data.Columns.Add("column2", typeof(string));
data.Columns.Add("column3", typeof(string)); data.Rows.Add("c01", "c02", "c03");
data.Rows.Add("c11", "c12", "c13");
data.Rows.Add("c21", "c22", "c23"); data.AcceptChanges(); this.dataGridView1.DataSource = data;
} // 隐藏
private void button1_Click(object sender, EventArgs e)
{
var data = (DataTable)this.dataGridView1.DataSource;
var currentDatas = data.Select("", "", DataViewRowState.Unchanged);
if (currentDatas.Length > 0)
currentDatas[0].Delete();
} // 全部再显示
private void button2_Click(object sender, EventArgs e)
{
var data = (DataTable)this.dataGridView1.DataSource;
data.RejectChanges();
}