0
が、私は6列のデータグリッドを持ちました私はDataGridの最後の行のparamsを設定し、新しい行を追加された機能を書いてきましたC#移入DataGridのコンボボックス、チェックボックスとテキストボックス
public class GridLine
{
public string sColumnA { get; set; }
public bool bError { get; set; }
public string sColumnB { get; set; }
public bool bNullableB { get; set; }
public bool bCollateB { get; set; }
public bool bStaticB { get; set; }
public string sStaticB { get; set; }
(...)
}
グリッド線のリストでm個の保持は、オブジェクトが、正しく動作していない - 私は最後の行が正しく設定上の唯一のコンボボックスを取得しています、その他:
private void AddLine(GridLine gl)
{
DataGridViewComboBoxCell cellMs = (DataGridViewComboBoxCell)this.Rows[this.Rows.Count - 1].Cells[0];
DataGridViewComboBoxCell cellOra = (DataGridViewComboBoxCell)this.Rows[this.Rows.Count - 1].Cells[1];
DataGridViewCheckBoxCell cellNull = (DataGridViewCheckBoxCell)this.Rows[this.Rows.Count - 1].Cells[2];
DataGridViewCheckBoxCell cellColl = (DataGridViewCheckBoxCell)this.Rows[this.Rows.Count - 1].Cells[3];
DataGridViewCheckBoxCell cellStat = (DataGridViewCheckBoxCell)this.Rows[this.Rows.Count - 1].Cells[4];
DataGridViewTextBoxCell cellStatText = (DataGridViewTextBoxCell)this.Rows[this.Rows.Count - 1].Cells[5];
cellMs.Value = gl.sColumnA;
cellOra.Value = gl.sColumnB;
cellNull.Selected = gl.bNullableB;
cellColl.Selected = gl.bCollateB;
cellStat.Selected = gl.bStaticB;
cellStatText.Value = gl.sStaticB;
this.Rows.Add();
}
私は何が間違っているのか分かりません。
感謝