10 個のプロパティを持つカスタム クラスがあります。そのうちの 5 つだけをグリッド ビューの列として表示する必要があります。これまでのところ、私はこれを試しました:
gridView1.DataSource = reservation; // This is a List of ReservationDomain (Custom Class with the properties I want to populate in the gridview)
gridView1.DataBind();
gridView1.Columns[2].Visible = false; // At this point of time the Columns count is ZERO, so an exception is thrown.
それを行う方法は何ですか。私は検索しましたが、同じ方法を見つけることができた場所、または内部的に同じことをしているLINQを介して見つけることができました。