DataGridコントロールは、表示したい列をaspxファイルで定義しておき、データ連結を行ってデータソースの要素を表形式で表示するというのが基本的な使用方法である。しかしデータ連結を行った後でも、グリッド内の各セルにアクセスし、セル内のテキストを変更したり、セルのプロパティを設定したりすることが可能だ。 DataGridコントロールを構成するオブジェクト グリッド内のセルにアクセスするには、データ連結後のDataGridコントロールを構成するオブジェクトについて把握しておく必要がある。 まず、DataGridコントロールの各行はDataGridItemクラス(System.Web.UI.WebControls名前空間)のオブジェクトで表される。これはDataGridコントロール(DataGridクラス)のItemsプロパティからアクセス可能だ。Itemsプロパティは複数のDataGrid