What is the best way to upload ALL this data? How to popular Datagridview when creating a form without a Delay occurring on its opening?
Paginando a Datagridview. This answer of the SO gringo has an example which I reproduce translated below:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace ExemploPaginacao
{
public partial class Form1 : Form
{
private const int totalRegistros = 15000;
private const int tamanhoPagina = 50;
public Form1()
{
InitializeComponent();
dataGridView1.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Index" });
bindingNavigator1.BindingSource = bindingSource1;
bindingSource1.CurrentChanged += new System.EventHandler(bindingSource1_CurrentChanged);
bindingSource1.DataSource = new ListaPaginada();
}
private void bindingSource1_CurrentChanged(object sender, EventArgs e)
{
// Este evento prepara um novo conjunto de registros quando o Current (propriedade que indica o registro atual da Grid é mudado
int deslocamento = (int)bindingSource1.Current;
var registros = new List<Registro>();
for (int i = deslocamento; i < deslocamento + tamanhoPagina && i < totalRegistros; i++)
registros.Add(new Registro { Index = i });
dataGridView1.DataSource = registros;
}
class Registro
{
public int Index { get; set; }
}
class ListaPaginada: System.ComponentModel.IListSource
{
public bool ContemColecaoDeListas { get; protected set; }
public System.Collections.IList GetList()
{
// Retorna uma lista de deslocamentos de página baseada em "totalRegistros" and "tamanhoPagina"
var deslocamentosPaginas = new List<int>();
for (int deslocamento = 0; deslocamento < totalRegistros; deslocamento += tamanhoPagina)
deslocamentosPaginas.Add(deslocamento);
return deslocamentosPaginas;
}
}
}
}
Has anyone ever used Nhibernate with Reactive?
Can you improve this part of the question? This part is based on opinions and does not fit a good answer, therefore.