C# 對NEW Datatable過濾排序,為何會影響到DataGridView的顯示,BUG嗎?
見代碼
paras = new SqlParameter[]{
new SqlParameter("@type", "待復核明細"),
new SqlParameter("@fhdjbh", PubVar.djbh)
};
dt = PubVar.sql.RunProcedureDR("LJH_FHT_mxfh", paras);
DataGridView1.DataSource = dt;
DataTable dtNew = dt;
string cxStr = string.Format("sptm LIKE '{0}%' or spbh like '%{0}%' or zjm like '%{0}%'", "a");
//排序,過濾
dtNew.DefaultView.RowFilter = cxStr;
dtNew.DefaultView.Sort = "pihao,shl";
如上代碼:有個DataGridView,已經設置數據源了,我重新NEW了一個DataTable dtNew後,對dtNew排序或者過濾 界面的DataGridView1都會跟著變,求高人指導
DataTable dtNew=dt.Clone();