如何将DataGrid的特定Column的宽度绑定到WPF中的Textbox宽度 [英] How to bind the width of specific Column of DataGrid to the Textbox width in WPF

查看:433
本文介绍了如何将DataGrid的特定Column的宽度绑定到WPF中的Textbox宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将DataGrid的特定列的宽度绑定到WPF中文本框的宽度。

我该怎么办?

提前谢谢

I want to bind the width of a specific column of a DataGrid to the width of a Textbox in WPF.
How can i do it?
Thanks in advance

推荐答案

我自己完成了:



I have done it myself:

<textbox name="txtID" minwidth="60" width="{Binding ElementName=hID,Path=ActualWidth}" horizontalalignment="Left" verticalalignment="Center" horizontalcontentalignment="Center" textchanged="txtID_TextChanged" />





其中hID是列的名称



where hID is the name of the column


这篇关于如何将DataGrid的特定Column的宽度绑定到WPF中的Textbox宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆