Y
Y
yeezussniper2021-04-07 09:57:09
C++ / C#
yeezussniper, 2021-04-07 09:57:09

How to remove visibility of datagridview rendering?

Hello. There is a datagridview. When switching tabs, etc. each time a table is redrawn with a visible effect. How can this be solved or bypassed.

My form code:

using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            this.BindGrid();

        }

        private void BindGrid()
        {
            string constring = @"Data Source=192.168.5.191;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=P5jc5W39G";
            using (SqlConnection con = new SqlConnection(constring))
            {
                using (SqlCommand cmd = new SqlCommand("SELECT * FROM skv", con))
                {
                    cmd.CommandType = CommandType.Text;
                    con.Open();
                    DataTable dt = new DataTable();
                    dt.Load(cmd.ExecuteReader());
                    dataGridView1.DataSource = dt;
                    con.Close();
                }
            }
        }
    }
}


What it looks like visually:

ibb.co/87B83jC

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question