猿问

winform高手进...

public partial class Form1 : Form    {        BindingSource source;        public Form1()        {            InitializeComponent();            List list = new List();            list.Add(new Source            {                ID = "1",                Name = "c#"            });            list.Add(new Source            {                ID = "2",                Name = "JAVA"            });            source = new BindingSource();            source.DataSource = list;            this.dataGridView1.DataSource = source;        }         private void textBox1_TextChanged(object sender, EventArgs e)        {            source.Filter = " '%" + textBox1.Text.Trim().ToUpper() + "%'";        }    }    public class Source    {        public string ID { get; set; }        public string Name { get; set; }    }   Filter无效。。请问高手为什么??网上查了。必须用datatable或dataset做数据源。。如果非要用list。。。要怎么处理??神人进。。。
富国沪深
浏览 471回答 1
1回答

凤凰求蛊

就用datatable怎么了?list转成datatable又不麻烦
随时随地看视频慕课网APP
我要回答