c# - How to set TextBox to be resized when DataGridTemplateColumn size changes -
i tried stuff didn't work. maybe missed something. goal have fill horizontally column textedit , have autoresized when user change column size dragging.
<datagrid> <datagrid.columns> <datagridtemplatecolumn width="200"> <datagridtemplatecolumn.headertemplate> <datatemplate> <textbox/> </datatemplate> </datagridtemplatecolumn.headertemplate> </datagridtemplatecolumn> </datagrid.columns> </datagrid>
add header style
datagrid
.
<datagridtemplatecolumn width="200"> <datagridtemplatecolumn.headerstyle> <style targettype="{x:type datagridcolumnheader}"> <setter property="horizontalcontentalignment" value="stretch"/> </style> </datagridtemplatecolumn.headerstyle> <datagridtemplatecolumn.headertemplate> ... </datagridtemplatecolumn.headertemplate> ...
Comments
Post a Comment