Sifting operation in InitializeDataSource can not work ?

7 replies. Last post: September 14, 2011 11:14 PM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
xu guochunMember

Hi ,

   In my project code , I find the sifting operation can not work .

 protected void WG1_InitializeDataSource(object sender,    ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
            DataView dv = Job.Select_AllJob();
            string strRowFilter = " 1=1 ";
            if (txtJobName.Text != "")
                strRowFilter += "  and JobName like '%" + txtJobName.Text + "%'";
            dv.RowFilter = strRowFilter;
e.DataSource = dv; }
 protected void btnSearch_Click(object sender, EventArgs e)
{
            RefreshGrid(WG1, true);
}

   When I click the search button to sift the data from database according to the jobname , I find the result is the same as before . Then I debug my code , I find " dv.RowFilter " have the sifted data , but after executing the code of " e.DataSource = dv; " , the rusult is the same as before . It mean the data from database is not be sifted .

  Anyone can help me ? Thank you very much !

All times are GMT -5. The time now is 12:48 AM.
Previous Next