So I'm building a silverlight datagrid dynamically (columns and cells) and I need my users to be able to change the column headers. I used a DataTemplate with a TextBox binded to the Header (I think) on the DataGridColumnHeader.ContentTemplate.
<DataTemplate xmlns='http://schemas.microsoft.com/client/2007'>
<TextBox Text='{Binding}' />
</DataTemplate>
However when I change the textbox's text the actual Header value does not change. I think I need to use 2 way binding but i'm not sure how that would work. I've been trying to wrap my head around silverlight/wpf bindings but am struggling a bit.
I suppose I could use a textbox.textchanged event to update them or something like that. But I think it would be cleaner in xaml.
Any suggestions? I feel like someone must have created a DataGrid with editable column headers.