I have the following code and when i click on page number..it shows nothing..it shows data for the first time but on the second time it doesnt.

Also i believe that the pageindexchanged is not getting called. howver if i remove (!PageIspostback) it works fine.

can somebody plz help me in this coz it has taken a lot of my time and i would appreciate any help.

public partial class ThmbListing : System.Web.UI.UserControl
{

#region Fields ------------------------------------------------------------------------

public DataSet ds = new DataSet();
public DataTable myPropertyTable = new DataTable();
public Icon icon;

#endregion


protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
MyDataBind();
}

}

public void MyDataBind()
{

this.icon = new Icon();
SqlConnection cn = new SqlConnection();
cn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["DBConnectionString"];
SqlDataAdapter da = new SqlDataAdapter("select * from ResidentialListingView", cn);
da.Fill(ds);
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
cn.Close();


}

protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{

ViewState["CurrentPage"] = e.NewPageIndex;
DataGrid1.CurrentPageIndex = e.NewPageIndex;
MyDataBind();
}

}

}
}