DataGrid
WPFアプリケーションにがあります。選択すると、テキストボックスの6列目に値が表示されます。だから私はの選択したアイテムをにバインドしdatagrid
ましたtextbox
コード:
myTextBox1.SetBinding(TextBox.TextProperty,
(new Binding("SelectedItem." + dataGrid1.Columns[5].Header)
{
ElementName = "dataGrid1"
}));
Xamlのコードビハインドでは、XamlParseExceptionがスローされています。
<TextBlock Name="myTextBox1" />
エラー:
Set connectionId threw an exception.'whose inner excpetion is
{"Unable to cast object of type 'System.Windows.Controls.TextBlock'
to type 'System.Windows.Controls.TextBox'."}
どうすればこれを修正できますか?