hi,

public void bingdrid()
    {
        cmd.Connection = con;
        cmd.CommandText = "SELECT     Customer.* , convert(varchar(50),StarteTime,103),convert(varchar(50),EndTime,103), CompanyMaster.Name, Country.CountryName, City.CityName, State.StateName " +
                    "FROM  Customer INNER JOIN "+
                     " CompanyMaster ON Customer.CompanyID = CompanyMaster.CompanyID INNER JOIN "+
                     " City ON Customer.CityID = City.CityID INNER JOIN "+
                      "Country ON Customer.CountryID = Country.CountryID INNER JOIN "+
                      "State ON Customer.StateID = State.StateID AND City.StateID = State.StateID AND Country.CountryID = State.CountryID ";
        da.SelectCommand = cmd ;
        da.Fill(ds);
        grvCusto.DataSource = ds;
        grvCusto.DataBind();
       
    }









 protected void grvCusto_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        grdstate.PageIndex = e.NewPageIndex;
        bingdrid();
    }

there is problem in this..
paging of grid is not working properly.


thanks in advance.


jack

Recommended Answers

All 2 Replies

You have to set AllowPaging=true property of GridView.

public void bingdrid()
    {
        cmd.Connection = con;
        cmd.CommandText = "SELECT     Customer.* , convert(varchar(50),StarteTime,103),convert(varchar(50),EndTime,103), CompanyMaster.Name, Country.CountryName, City.CityName, State.StateName " +
                    "FROM  Customer INNER JOIN "+
                     " CompanyMaster ON Customer.CompanyID = CompanyMaster.CompanyID INNER JOIN "+
                     " City ON Customer.CityID = City.CityID INNER JOIN "+
                      "Country ON Customer.CountryID = Country.CountryID INNER JOIN "+
                      "State ON Customer.StateID = State.StateID AND City.StateID = State.StateID AND Country.CountryID = State.CountryID ";
        DataTable ds=new DataTable(); 
        da.SelectCommand = cmd ;
        da.Fill(ds);
        grvCusto.DataSource = ds;
        grvCusto.DataBind();
       
    }

thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.