views:

27

answers:

1

Hello My Project include dataGridView Control, and i change the property: gridview1.columns.DataPropertyName at run time Now, i need rebind my gridView, how i do this. in asp.net is simple gridView1.DataBind(), bun how in c#.

i try to do this:

this.gridview1.DataSource = "MyDataSource"
this.gridview1.refresh() 

and it's not working..

Thanks..

+1  A: 

Try

this.gridview1.DataSource = null;
this.gridview1.DataSource = "MyDataSource" ;

The Refresh isn't necessary.

Henk Holterman
thank you Henk Holterman it work!
liran