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

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

I have the control placed in DataGrid like this:

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-06 21:59

    There is also a static method to do this (analogous to using the property in code to set a non-attached property rather than using the DP there).

    Grid.SetRow(txtDescription, 1);
    

    You may find this more readable.

提交回复
热议问题