or
using
System;
using
System.Collections.Generic;
using
System.Windows.Forms;
namespace
GridTest1
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
List<Data> list =
new
List<Data>();
list.Add(
new
Data() { Value =
"A"
});
list.Add(
new
Data() { Value =
"B"
});
list.Add(
new
Data() { Value =
"C"
});
bindingSource1.DataSource = list;
}
private
void
btnChangeData_Click(
object
sender, EventArgs e)
{
List<Data> list =
new
List<Data>();
list.Add(
new
Data() { Value =
"A"
});
bindingSource1.DataSource = list;
}
}
public
class
Data
{
public
string
Value {
get
;
set
; }
}
}