Exemplo n.º 1
0
        private void txtPesquisar_TextChanged(object sender, EventArgs e)
        {
            CategoriaBLL categoriaBLL = new CategoriaBLL();

            CategoriaCollection categoriaCollection = new CategoriaCollection();

            categoriaCollection = categoriaBLL.ConsultarPorNome(txtPesquisar.Text, 1); // rever

            dataGrid.DataSource = null;
            dataGrid.DataSource = categoriaCollection;
            dataGrid.Update();
            dataGrid.Refresh();
        }
Exemplo n.º 2
0
        private void TxtPesquisar_TextChanged(object sender, TextChangedEventArgs e)
        {
            CategoriaBLL categoriaBLL = new CategoriaBLL();

            CategoriaCollection categoriaCollection = new CategoriaCollection();

            categoriaCollection = categoriaBLL.ConsultarPorNome(txtPesquisar.Text, 0);

            //dataGrid.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = null });
            //dataGrid.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = categoriaCollection });
            dataGrid.ItemsSource = categoriaCollection;


            //dataGrid.Items.Refresh();
        }