My datagrid is not showing after paging.

  • Thread starter Luis Esteban Valencia
  • Start date
L

Luis Esteban Valencia

I dont know what happens, but when I click on page 2 it disappears. I made a
breakpoint on each line of page:_indexchanged and the visible property is
equal to true.


this is my code

private void Page_Load(object sender, System.EventArgs e)

{

// Introducir aquí el código de usuario para inicializar la página

if(!Page.IsPostBack)

{

System.Configuration.AppSettingsReader configurationAppSettings = new
System.Configuration.AppSettingsReader();

sqlConnection1.ConnectionString =
((string)(configurationAppSettings.GetValue("Conexion1", typeof(string))));

cargarProveedores();

cargarComprobantes();

}

}



private void cargarComprobantes()

{

SqlDataAdapter sqlDataAdatper2= new SqlDataAdapter("select * from
vwCompProveedores order by fecha", sqlConnection1);

DataSet ds = new DataSet();

sqlDataAdatper2.Fill(ds, "proveedores");

dgComprobantes.DataSource = ds;

dgComprobantes.DataBind();

}





private void dgComprobantes_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)

{

dgComprobantes.CurrentPageIndex = e.NewPageIndex;

dgComprobantes.DataBind();


}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top