سؤال

I tried the code below, but it does not work. What's wrong?

private void textBox1_TextChanged(object sender, EventArgs e)
{
    // DataView component
    DataView view = new DataView();
    view.Table = database1DataSet1.Tables["sample"];
    view.RowFilter = "surname LIKE '%" + textBox1.Text + "%'";
}
هل كانت مفيدة؟

المحلول

I believe that you need to add the following line after setting the view.RowFilter:

DataGridView1.DataSource = view;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top