简体   繁体   中英

DataGridView in C# WinForm

I have datagridview on my winform. I have data from some other processes coming frequently that need to be printed on datagridview. Which datagridview event fires frquently where I can print my data? Is it possible by some event or some other approach is required?

You can create a methode which is called everytime you need to print the datagridview.

dt2.Rows.Clear(); //clear datagridview
//dt2 is a datatable
//here u can load your data into a datatable or what every you want
dataGridView2.DataSource = dt2;

Put this code into a methode a call it everytime you need it. (eg timer every 5 sec)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM