protected void FilterButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.FilterTextBox.Text))
{
this.GridView1.DataSource = db.Yetenekler.Local.ToBindingList();
}
else
{
var filteredData = db.Yetenekler.Local
.Where(x => x.adi.Contains(this.FilterTextBox.Text));
this.GridView1.DataSource = filteredData;
}
}
返回
答案 0 :(得分:0)
您需要将数据绑定到网格.DataBind();
上以刷新它。
protected void FilterButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.FilterTextBox.Text))
{
this.GridView1.DataSource = db.Yetenekler.Local.ToBindingList();
this.GridView1.DataBind();
}
else
{
var filteredData = db.Yetenekler.Local
.Where(x => x.adi.Contains(this.FilterTextBox.Text));
this.GridView1.DataSource = filteredData.ToList();
this.GridView1.DataBind();
}
}