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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -