WPF ComboBox & ListView Load From Database

Combox load & Listview load for our application is one of the most important task in our Development.
For ComboBox:


      private void LoadVendorTYpeComboBox()
        {
            vendorTYpecomboBox.Items.Clear();
            ObjVendorTypeList = ObjBvendorType.GetAllVendirType();
            foreach (EVendorType obj in ObjVendorTypeList)
            {
                vendorTYpecomboBox.Items.Add(obj.VendorType);
            }

          
        }

For ListView:

   private void LoadVendorTypeListView()
        {
            vendorTypelistView.Items.Clear();
            ObjVendorTypeList = ObjBvendorType.GetAllVendirType();
            foreach (EVendorType obj in ObjVendorTypeList)
            {
                vendorTypelistView.Items.Add(obj);
            }
        }

for listview you have to bind the object in list column.

<GridViewColumn DisplayMemberBinding="{Binding Path=VendorType}"  Header="Vendor Type" Width="100"/>

Enjoy...

Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report