2
Good afternoon to you... I have a datagridview that loads several lines, I’ve been searching on the net how I can paginate this datagridview, but I could not perform such procedure, because I have not so much experience in c#, so I would ask here again for the help of the forum to be able to paginate the datagridview, or to create pages in datagridview.
follows the code that loads the datagrid
private void ListaGrid()
{
try
{
SqlCommand tabnet = new SqlCommand("usp_TabelaPrecosNet", conexaoDADOADV(true));
tabnet.Parameters.AddWithValue("@CODTABELA", this.cb_tabela.Text);
tabnet.CommandType = CommandType.StoredProcedure;
tabnet.ExecuteNonQuery();
SqlDataAdapter dados = new SqlDataAdapter(tabnet);
DataTable dtLista = new DataTable();
dados.Fill(dtLista);
dgw_listanet.DataSource = dtLista;
dgw_listanet.Columns["CODPRODUTO"].HeaderText = "COD.PRODUTO";
dgw_listanet.Columns["DESCRICAO"].HeaderText = "PROD. DESCRIÇÃO";
dgw_listanet.Columns["IPI"].HeaderText = "% IPI";
dgw_listanet.Columns["PRECO"].HeaderText = "PREÇO NET";
dgw_listanet.Columns["MOEDA"].HeaderText = "TIPO MOEDA";
}
catch
{
MessageBox.Show("Não exstem dados digitados para a consulta, por favor verificar!!!");
return;
}
}
Leandro good afternoon and thanks for your attention, now let me see if I understand, I need to put all this query inside my porcedure and this or I have to create a new Process.
– Junior Guerreiro
You must implement these parameters in your query. In short, change the select from the example to your query in the process.
– Leandro Raveli