private void llenarArbolCategoria() { treeViewCategoria.Items.Clear(); TreeViewItem parent = new TreeViewItem(); parent.Header = "Categorias"; parent.IsSelected = true; treeViewCategoria.Items.Add(parent); TreeViewItem nuevoChild = new TreeViewItem(); nuevoChild.Header = "All"; nuevoChild.IsSelected = true; //newChild.Items.Add(newSubChild1); List <string> nombrecat = new List <string>(); nombrecat.Add("All"); categoriaFacade catFlista = new categoriaFacade(); List <Categoria> listaCategoria = catFlista.getCategoria(); foreach (Categoria v in listaCategoria) { nombrecat.Add(v.nombreCategoria); } parent.ItemsSource = nombrecat; }
private void llenarComboBCategoria() { categoriaFacade catFlista = new categoriaFacade(); List <Categoria> listaCategoria = catFlista.getCategoria(); cbCategoria.Items.Clear(); foreach (Categoria v in listaCategoria) { cbCategoria.Items.Add(v.nombreCategoria); } cbCategoria.SelectedIndex = 0; }