TextBox と datarow の列をバインドしたいのですが、うまくいきません。私のコード:
// Member is a DataRow
for(int i=0;i<Member.Table.Count;++i)
{
TextBox textbox = TextBox();
textbox.Text = Member.Field<string>(i);
Binding binding = new Binding(Member.Table.Columns[i].ColumnName);
binding.Source = Member;
binding.Path = new PropertyPath(Member.Table.Columns[i].ColumnName);
binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
binding.Mode = BindingMode.TwoWay;
textbox.SetBinding(System.Windows.Controls.TextBox.TextProperty, binding);
}
何か案が?考える