0

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

Edited by __avd: Added [code] tags.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by jackparsana
0

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();
       
    }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.