Friday, October 21, 2011

WPF DataGrid Cell Color Change

DataGrid's ROW & CELL color Changing is one of most important part in our development. if you want to change Data grid specific cell Background just like:

use the xaml code for "Remaining Day" column in your Datagrid.

 <DataGridTemplateColumn Header="Remaining Day" Width="150">  
                     <Border x:Name="brdBroder" VerticalAlignment="Stretch" Margin="1">  
                          <TextBlock Text="{Binding RemainLeave}" Margin="3,1" x:Name="txtTextBlock"/>  
                          <DataTrigger Binding="{Binding RemainLeave}" Value="0">  
                               <Setter TargetName="brdBroder" Property="Background" Value="Green"/>  
                               <Setter TargetName="txtTextBlock" Property="Foreground" Value="White"/>  


C# print file on LAN Printer

If you want to print any file on network printer then you can try with this code block // Change Default Printer System.Ma...