2
를 표시하지 않습니다System.Windows.Forms.DataGridView 내가 뭐하는 거지 모두가 간단 데이터
// Both the methods, order.GetAllOrderItems() and order.GetOrderedItemsWhereBrandIs("foo")
// return an IEnumerable<T> so the assignment to the DataSource property of the DataGridView
// should be fine. The problem is in re-assigning the data source property.
public void DisplayItems()
{
// The data appears if I have just this line.
dgvOrderedItems.DataSource = order.GetAllOrderItems();
dgvOrderedItems.DataSource = null;
// This time the data grid does not take the new data source. Instead, because
// of the null assignment in the previous statement, it displays no data at all.
dgvOrderedItems.DataSource = order.GetOrderedItemsWhereBrandIs("Lenovo");
}
내 질문은 : 그것은되면 DataGridView 컨트롤의 데이터 소스를 변경하는 방법은 무엇입니까 세트? 개발을 위해 C# 4.0과 Visual Studio 2010을 사용하고 있습니다.
실례로, 당신은 영웅입니다! 너는 그 사람이야! –