日期:2014-05-17 浏览次数:20517 次
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
List<User> list = new List<User>();
for (int i = 0; i < 100; i++)
{
User u = new User();
u.id = i;
u.weburl = "http://www.baidu.com";
u.logintype = "uid";
u.username = "baidu";
u.password = "123456789";
u.datetime = DateTime.Now.ToString("hh:mm:ss");
u.content = "建设中...";
list.Add(u);
}
this.DataGridView_User.DataSource = new BindingList<User>(list);
//this.DataGridView_User.DataSource = list;
}
private void button1_Click(object sender, EventArgs e)
{
}
}
public class User
{
public int id;
public string weburl;
public string logintype;
public string username;
public string password;
public string datetime;
public string content;
}
public class User
{
public int id { get; set; }
&nb