i want the rows to appear one at a time, having a delay before each row as it appears in datagrid
What I have tried:
I have tried this code but it shows all the data from the database all at once, what i want is that it would show the rows 1 at a time with a delay of lets say 500 millisecond before the next row appear.
private async void button_Load_Click(object sender, EventArgs e)
{
await a.DisplayData(dataGridView1);
var connection = @"connectionstring";
var command = @"SELECT * FROM table";
var data = await LoadData(command, connection);
this.dataGridView1.DataSource = data;
}
public async Task<datatable> LoadData(string connection, string command)
{
var dt = new DataTable();
using (var adapt = new SqlDataAdapter(connection, command))
await Task.Run(() => adapt.Fill(dt));
//await Task.Delay(1000);
return dt;