Quantcast
Channel: paginacion gridview asp.net C#
Viewing all articles
Browse latest Browse all 3

paginacion gridview asp.net C#

$
0
0

Hola compañeros  

necesito ayuda>    

en una pagina web en un grid view quiero hacer una paginacion, pero no se como hacerle porque me sale error al momento que le doy clic cualquiera de los nuemros como se muestra la imagen 

Este es mi codigo de aspx una cierta parte

    <tr>
            <td colspan="2" class="text">
                 <asp:GridView ID="Datos_ventas" runat="server" AutoGenerateColumns="true" AllowPaging="True"PageSize="100" OnPageIndexChanging="Generar_ventas_Click">
                     <PagerSettings Mode="NumericFirstLast"/>
                 </asp:GridView>
            </td>
        </tr>

este es el codigo de C# 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BD_Database;
using System.Data;
using System.Collections;
using System.Web.UI.HtmlControls;

public partial class Soporte_Reporte_Gasolineras_ventas : System.Web.UI.Page
{
  
    public Connection _conDataBase = new Connection(ApplicationConfiguration.Instance.ConnectionString);

    public string strGasolinera_ID = "";
    public StoredProcedure sp_call = null;
    public DataTable dt;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack) { 
            strGasolinera_ID = Id_Gasolineras.SelectedValue.ToString();
            //id_pemex = Id_Gasolineras.SelectedValue.Length;
            

            sp_call = new StoredProcedure("sp_Gasolinera_List", _conDataBase);
            DataTable dtgasolineras = new DataTable();
            dtgasolineras = sp_call.getDataTable();
            Id_Gasolineras.DataSource = dtgasolineras;
            Id_Gasolineras.DataTextField = "Nombre";
            Id_Gasolineras.DataValueField = "Id";
            Id_Gasolineras.DataBind();
        }
        // Id_Gasolineras.Items.Insert(0, new ListItem("seleccione...", "-1"));
    }
    protected void Reportes_Ventas_Load(object sender, EventArgs e)
    {
    }

    public void Generar_ventas_Click(object sender, EventArgs a)
    {
        
        int id_pemex = Convert.ToInt32(Id_Gasolineras.SelectedValue.ToString());
        string fecha_ini = Fecha_Inicial.Text;
        string fecha_finales = Fecha_Final.Text;
        DateTime fecha_inicio = Convert.ToDateTime(fecha_ini);
        DateTime fecha_fin = Convert.ToDateTime(fecha_finales);
        bool id_empresa = Orden_Empresa.Checked;
        bool ordenfecha = Orden_Cronologico.Checked;

 
        
        Importar_Detalles_ventas generar_detalles = new Importar_Detalles_ventas();
        dt = generar_detalles.Detalles_ventas(id_pemex, id_empresa, fecha_inicio, fecha_fin, ordenfecha);
        Datos_ventas.DataSource = dt;
        Datos_ventas.DataBind();
       
        dt = generar_detalles.Detalles_Consumo_total(id_pemex, fecha_inicio, fecha_fin);
        ConsumosTotal.DataSource = dt;
        ConsumosTotal.DataBind();



    }
}


 

Viewing all articles
Browse latest Browse all 3

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>