当前位置:网站首页>[C language] DataGridView binding data
[C language] DataGridView binding data
2022-07-29 08:45:00 【Wenbus】
When engineers are doing development , The data needs to be in the form of charts , Present on the desktop . therefore , Data grid view tools need to bind data .
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test_DataGridView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.DataSource = Source();
}
private DataTable Source()
{
DataTable mydt = new DataTable();
mydt.Columns.Add(" full name ");
mydt.Columns.Add(" fraction ");
String[,] str = new String[,] { { " Zhang San ", "90" }, { " Li Si ", "93" }, { " Wang Wu ", "99" } };
for (int i = 0; i < 3; i++)
{
DataRow dr = mydt.NewRow();
dr[0] = str[i, 0];
dr[1] = str[i, 1];
mydt.Rows.Add(dr);
}
return mydt;
}
}
}
边栏推荐
- Analysis of zorder sampling partition process in Hudi - "deepnova developer community"
- Basic shell operations (Part 2)
- 2022年山东省安全员C证上岗证题库及答案
- Classic interview question: = = the difference between equals
- Third week weekly report resnet+resnext
- Personal study notes
- Second week of postgraduate freshman training: convolutional neural network foundation
- 2022电工(初级)考题模拟考试平台操作
- HC-SR04超声波测距模块使用方法和例程(STM32)
- access数据库可以被远程访问吗
猜你喜欢
Clickhouse learning (II) Clickhouse stand-alone installation
SAP sm30 brings out description or custom logical relationship
优秀的Allegro Skill推荐
2022 spsspro certification cup mathematical modeling problem B phase II scheme and post game summary
2022年P气瓶充装考试模拟100题模拟考试平台操作
(Video + graphic) introduction to machine learning series - Chapter 3 logical regression
BI data analysis practitioners learn financial knowledge from scratch? What introductory books are recommended
2022 electrician (elementary) test question simulation test platform operation
用户身份标识与账号体系实践
PostgreSQL manually creates hikaridatasource to solve the error cannot commit when autocommit is enabled
随机推荐
(视频+图文)机器学习入门系列-第2章 线性回归
Personal study notes
【OpenCV】-算子(Sobel、Canny、Laplacian)学习
MySQL statement mind map
状态压缩dp
Day15: the file contains the vulnerability range manual (self use file include range)
HC-SR04超声波测距模块使用方法和例程(STM32)
[opencv] - Operator (Sobel, canny, Laplacian) learning
centos7/8命令行安装Oracle11g
Regular expression verification version number
Virtual augmentation and reality Part 2 (I'm a Firebird)
SAP ooalv-sd module actual development case (add, delete, modify and check)
Play Parkour with threejs Technology
WQS binary learning notes
Count the list of third-party components of an open source project
Data is the main body of future world development, and data security should be raised to the national strategic level
Node: file write data (readfile, WriteFile), two modes: overwrite and increment
C language watch second kill assist repeatedly
Sword finger offer 26. substructure of tree
2022危险化学品经营单位主要负责人操作证考试题库及答案