ふらっとC#,C♯,C#(初心者用) Part45at TECH
ふらっとC#,C♯,C#(初心者用) Part45 - 暇つぶし2ch524:デフォルトの名無しさん
09/10/04 11:40:13
>>523に追加
以下のdataGridView1と同じ動作をdataGridView2にさせたいのですが・・

BindingSource bs = new BindingSource();
List<testclass> testlist = new List<testclass>();
List<testclass> testlist2 = new List<testclass>();

private void button1_Click(object sender, EventArgs e)
{
bs.DataSource = testlist;
dataGridView1.DataSource = bs;

bindingSource1.DataSource = testlist;
//dataGridView2.DataSource = bindingSource1;
}
private void button2_Click(object sender, EventArgs e)
{
bs.DataSource = testlist2;
dataGridView1.DataSource = bs;

bindingSource1.DataSource = testlist2;
}
private void Form1_Load(object sender, EventArgs e)
{
testlist.Add(new testclass { A = "A1", B = "B1" });
testlist.Add(new testclass { A = "A2", B = "B2" });

testlist2.Add(new testclass { A = "a1", B = "d1" });
testlist2.Add(new testclass { A = "a2", B = "d2" });
}
以下略


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch