既存の GridView を使用していますが、ComboBoxColumn (displaymember、valuemember) と同様に、TextBoxColumn に別の値と表示を設定できる方法があるかどうかを知りたいです。
private System.Windows.Forms.DataGridViewTextBoxColumn PATH;
this.PATH.DataPropertyName = "Path";
this.PATH.HeaderText = "PATH";
this.PATH.Name = "Path";
this.PATH.ReadOnly = true;
this.PATH.Width = 186;
現在、ID を含む非表示の列がありますが、より良い解決策があるかどうか疑問に思っています。
ETA: PATH.DataPropertyName = "PathId" (更新に使用したい隠し値) と this.PATH.Name = "Path" (表示したい文字列値) を入れました。
列の値を取得すると、名前の値が返されます。
this.mySampleGridView.Rows[i].Cells["Path"].Value