I have a DGV that i've created with a datasource and a table adapter. In the table adapdter i've defined two parameters to make a search. So then i have a WPF with the data grid view and TWO textboxes wich i'll use to make the search.
public partial class FormConsultaAdvogadosDS : Form
{
public FormConsultaAdvogadosDS()
{
InitializeComponent();
}
private void FormConsultaAdvogadosDS_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSetAdvogados.Advogado' table. You can move, or remove it, as needed.
this.advogadoTableAdapter.Fill(this.dataSetAdvogados.Advogado);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
try
{
this.advogadoTableAdapter.FillBy(this.dataSetAdvogados.Advogado, textBox1.Text);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
try
{
this.advogadoTableAdapter.FillBy1(this.dataSetAdvogados.Advogado, textBox2.Text);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
}
This is the code i have right now. Whe i do the filtering with just one of the textboxes it's all ok, it filters all ok. But what i really need is a filter inside the first filtering. Like dependence of the first filteing. If i insert in the textbox1 the text "ABC" the rows displayed have "ABC" and then, with this first filter, i need to refine inserting in textbox2 "DEF", but it doesn't work. It make a new search ignoring the first filtering. Can someone help me? Regards