Datapager in Listview
-
Hello, My code is: if (!IsPostBack) { ds = cn.MasterBind("select * from TblEmp"); if (ds.Tables[0].Rows.Count > 0) { lstEmp.DataSource = ds.Tables[0]; lstEmp.DataBind(); dp1.Visible = true; dp1.SetPageProperties(0, dp1.MaximumRows, false); //ClearState(); } } i set datapager setproperties in page load and also i set on search button click event. dp1.SetPageProperties(0, dp1.MaximumRows, false); lstEmp.DataSource = dsParent.Tables[0]; lstEmp.DataBind(); But my search result will not display on first index of datapager.On first index my previous data is displayed when i click on 2 page,my search result is displayed. i also set false to true but it doesn't work. Do u have any suggestion,pls help me. Thanks
-
Hello, My code is: if (!IsPostBack) { ds = cn.MasterBind("select * from TblEmp"); if (ds.Tables[0].Rows.Count > 0) { lstEmp.DataSource = ds.Tables[0]; lstEmp.DataBind(); dp1.Visible = true; dp1.SetPageProperties(0, dp1.MaximumRows, false); //ClearState(); } } i set datapager setproperties in page load and also i set on search button click event. dp1.SetPageProperties(0, dp1.MaximumRows, false); lstEmp.DataSource = dsParent.Tables[0]; lstEmp.DataBind(); But my search result will not display on first index of datapager.On first index my previous data is displayed when i click on 2 page,my search result is displayed. i also set false to true but it doesn't work. Do u have any suggestion,pls help me. Thanks
Set property of Datapager after binding your "lstEmp" on click of your Search button. As below lstEmp.DataSource = dsParent.Tables[0]; lstEmp.DataBind(); dp1.visible = true; dp1.SetPageProperties(0, dp1.MaximumRows, false); Its just a guess. I dont have time to check this out. Please give a try once. ;)
Rashmi.M.K