How to change the Grid.Row and Grid.Column of the control from code behind in wpf

前端 未结 2 1934
后悔当初
后悔当初 2021-02-06 21:41

I have the control placed in DataGrid like this:

2条回答
  •  攒了一身酷
    2021-02-06 22:12

    Use DependencyObject.SetValue, passing in the DependencyProperty for Grid.Row and the value you want to assign:

    this.txtDescription.SetValue(Grid.RowProperty, 1);
    

提交回复
热议问题