How to align text in DataGrid

The obvious solution is to set a HorizontalAlignment property of DataGridCell style: 1 2 3 4 5 6 7 <DataGridTextColumn Binding="{Binding Quantity, StringFormat=’#,0.0000′}" ClipboardContentBinding="{x:Null}" Header="Quantity">     <DataGridTextColumn.CellStyle>         <Style TargetType="DataGridCell" >             <Setter Property="HorizontalAlignment" Value="Right" />         </Style>     </DataGridTextColumn.CellStyle> </DataGridTextColumn> <DataGridTextColumn […]
Continue reading…

 

How to create an object by class name using Reflection

1. When the class is defined in the same assembly, where your code is executed: 1 2 3 4 Dim _assemblyName As String = "MyAssembly" Dim _typeName As String = "MyNamespace.ExampleControl" Dim _type As Type = Assembly.Load(_assemblyName).GetType(_typeName, True) _control = Activator.CreateInstance(_type) Dim _assemblyName As String = “MyAssembly” Dim _typeName As String = “MyNamespace.ExampleControl” Dim _type […]
Continue reading…

 

How to dynamically generate SSRS Report

SSRS is a wonderful tool for quickly retrieving data and presenting it to the user in a format predefined at design-time. But what if there is a need to create a new report at run-time, based on some dynamic data structure or any specific user needs? Of course, for advanced business users Microsoft Report Builder […]
Continue reading…

 

How to handle Keyboard Focus Events globally in WPF

You will find quite a few cases when your application would need to handle the changing of keyboard focus globally at application level, not just on a single control element or even a form level. The simple adding listeners to all possible elements will not be an effective way and doesn’t guarantee you to have […]
Continue reading…