Wednesday, March 23, 2011

WPF Multicolumn ComboBox

In WPF Multicolumn ComboBox we can easily complete it By the following procedure:
Modify your Combobox maml as following:

================XAML  Binding ===============

 <ComboBox Height="23" HorizontalAlignment="Left" Margin="87,7,0,0" Name="ZoneBranchIDcomboBox" VerticalAlignment="Top" Width="160" >  
               <StackPanel Orientation="Horizontal">  
                 <TextBlock Text="{Binding ZoneBranchId}" Width="60"/>  
                   <TextBlock Text="|"/>  
                 <TextBlock Text="{Binding ZoneBranchName}" Width="60"/>  

==========Your UI Code for Load ComboBox:=========

 private void LoadBranchIDComboBox()  
 listOfZone = ObjBZoneSetup.GetAllBranchID();  
 foreach (EZoneSetup floorSetupObj in listOfZone)  
 ZoneBranchIDcomboBox.ItemsSource = listOfZone;  

=============== Business Logic============
 public List GetAllBranchID()  
 List listOfZoneBranchID = ObjZoneDAL.GetAllBranchID();  
 return listOfZoneBranchID;  

============== GateWay:=============
 public List GetAllBranchID()  
 List listOfBranchID = new List();  
 foreach (var ZoneSetup in objDataContext.SP_GET_BRANCH_NAME())  
 EZoneSetup eZoneSetupobj = new EZoneSetup();  
 eZoneSetupobj.ZoneBranchId = ZoneSetup.WI_ID;  
 eZoneSetupobj.ZoneBranchName = ZoneSetup.WI_NAME;  
 catch (Exception exception)  
 throw exception;  
 return listOfBranchID;  


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