title: GridView.Databind() not working with object list
body: <p>The problem I have is this: I have one GridView with a list objects as its data source, it binds with no problem. I have a DropDownList which have the event <code>SelectedIndexChanged</code>, and with this event, I add a new object to the list, after added I want to do a <code>GridView1.Databind()</code> so the new object appears in the GridView. </p>
  
  <p>But this does not work, after I do <code>GridView1.Databind()</code> the data from the GridView gets lost. It even shows the <code>EmptyDataText</code>, but if I refresh the page, everything appears. Also, the DropDownList uses an object list as DataSource and was supposed to use <code>DropDownList1.Databind()</code> but it doesn't work too. It has the same data after the DataBinding, what I did to correct at least the DropDownList was to set the <code>DropDownList again manually.DataTextField = object.attribute1</code> and  <code>DropDownList.DataValueField = object.attribute2</code>. But with the GridView I'm stuck, can someone explain how the method <code>DataBind</code> works with a list of objects?</p>