Enabling Word Wrap in the WPF DataGrid Column Headers

To enable Word Wrapping in the WPF Data Grid Column Header, simply add the following code snippet to your Application.xaml file; [code lang="XML"] <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock TextWrapping="Wrap" Text="{Binding}"></TextBlock> </DataTemplate> </Setter.Value> </Setter> </Style> [/code]

By |2014-07-08T09:34:14+01:00November 7th, 2012|.Net Framework, WPF|0 Comments

WPF DataGrid CheckBox Column requires two clicks to change state

While using a WPF DataGrid and a CheckBox column I realised that it was taking two Mouse clicks to change the state of the CheckBox. I found a good post by Mike Borozdin which explains how to work around this ‘issue’; http://www.mikeborozdin.com/post/WPF-DataGrid-CheckBox-Single-Click-CheckingUnchecking.aspx Basically, if instead of adding a CheckBox column, you add a TemplateColumn, and [...]

By |2012-10-22T16:50:00+01:00October 22nd, 2012|.Net Framework, Bugs, WPF|0 Comments

Windows Forms App with Splash Screen Throws–“Invoke or BeginInvoke cannot be called on a control until the window handle has been created.” Exception

I’ve come across a bug in the .Net Framework when developing a Windows Forms app, which has a Splash Screen. On some users machines, the application threw a “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.” exception at startup. This is seemingly to do with code executing [...]

By |2012-10-17T11:36:00+01:00October 17th, 2012|.Net Framework, Bugs, VB.net, Visual Studio|0 Comments