Saturday, May 7, 2011

WPF DateTime show in Listview and DataGrid

In our WPF application when we want to visualize the date in list or grid column. then it show us date by default with time. but we don't want to see the time. so we can control easily in xaml code of list or grid. example as:


 <ListView Height="147" HorizontalAlignment="Left" Margin="15,26,0,0" Name="lvCalList" VerticalAlignment="Top" Width="211">  
           <ListView.View>  
                <GridView>  
                     <GridViewColumn DisplayMemberBinding="{Binding Path=FromDate,StringFormat={}{0:MM/dd/yyyy}}" Header="From Date" Width="100" />  
                     <GridViewColumn DisplayMemberBinding="{Binding Path=ToDate,StringFormat={}{0:MM/dd/yyyy}}" Header="To Date" Width="105" />  
                </GridView>  
           </ListView.View>  
 </ListView>  

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...