-
大小: 29KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-05-22
- 语言: C#
- 标签: winform DataGridView
资源简介
winform DataGridView 多行及表头单元格的合并
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MultiColHeaderDgvTest
{
public partial class FrmTest : Form
{
public FrmTest()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
DataTable dtable = new DataTable(“Rock“);
//set columns names
dtable.Columns.Add(“Band“ typeof(System.String));
dtable.Columns.Add(“Song“ typeof(System.String));
dtable.Columns.Add(“Album“ typeof(System.String));
dtable.Columns.Add(“Album2“ typeof(System.String));
//Add Rows
DataRow drow = dtable.NewRow();
drow[“Band“] = “Iron Maiden“;
drow[“Song“] = “Wasted Years“;
drow[“Album“] = “Ed Hunter“;
drow[“Album2“] = “kG“;
dtable.Rows.Add(drow);
drow = dtable.NewRow();
drow[“Band“] = “metallica“;
drow[“Song“] = “Enter Sandman“;
drow[“Album“] = “metallica“;
drow[“Album2“] = “Tracy“;
dtable.Rows.Add(drow);
drow = dtable.NewRow();
drow[“Band“] = “Jethro Tull“;
drow[“Song“] = “Locomotive Breath“;
drow[“Album“] = “Aqualung“;
drow[“Album2“] = “Md“;
dtable.Rows.Add(drow);
drow = dtable.NewRow();
drow[“Band“] = “Mr. Big“;
drow[“Song“] = “Seven Impossible Days“;
drow[“Album“] = “Japandemonium“;
drow[“Album2“] = “Hunter“;
dtable.Rows.Add(drow);
multiColHeaderDgv2.DataSource = dtable;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1407 2008-10-13 10:12 myMultiColHeaderDgv\myMultiColHeaderDgv\Properties\AssemblyInfo.cs
文件 15766 2008-10-14 10:41 myMultiColHeaderDgv\myMultiColHeaderDgv\MultiColHeaderDgv.cs
文件 2196 2008-10-14 08:58 myMultiColHeaderDgv\myMultiColHeaderDgv\myMultiColHeaderDgv.csproj
文件 20480 2008-10-14 10:41 myMultiColHeaderDgv\myMultiColHeaderDgv\bin\Debug\myMultiColHeaderDgv.dll
文件 1463 2008-10-13 10:19 myMultiColHeaderDgv\myMultiColHeaderDgv.sln
..A..H. 22016 2008-10-14 10:46 myMultiColHeaderDgv\myMultiColHeaderDgv.suo
文件 5612 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest\Properties\Resources.resx
文件 249 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest\Properties\Settings.settings
文件 1290 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest\Properties\AssemblyInfo.cs
文件 2867 2008-10-13 13:15 myMultiColHeaderDgv\MultiColHeaderDgvTest\Properties\Resources.Designer.cs
文件 1100 2008-10-13 13:15 myMultiColHeaderDgv\MultiColHeaderDgvTest\Properties\Settings.Designer.cs
文件 1873 2008-10-14 10:44 myMultiColHeaderDgv\MultiColHeaderDgvTest\FrmTest.cs
文件 490 2008-10-14 08:57 myMultiColHeaderDgv\MultiColHeaderDgvTest\Program.cs
文件 5814 2008-10-14 10:44 myMultiColHeaderDgv\MultiColHeaderDgvTest\FrmTest.resx
文件 3563 2008-10-14 10:20 myMultiColHeaderDgv\MultiColHeaderDgvTest\MultiColHeaderDgvTest.csproj
文件 20480 2008-10-14 10:41 myMultiColHeaderDgv\MultiColHeaderDgvTest\bin\Debug\myMultiColHeaderDgv.dll
文件 24576 2008-10-14 10:44 myMultiColHeaderDgv\MultiColHeaderDgvTest\bin\Debug\MultiColHeaderDgvTest.exe
文件 6294 2008-10-14 10:44 myMultiColHeaderDgv\MultiColHeaderDgvTest\FrmTest.Designer.cs
目录 0 2008-10-13 10:12 myMultiColHeaderDgv\myMultiColHeaderDgv\bin\Debug
目录 0 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest\bin\Debug
目录 0 2008-10-13 10:12 myMultiColHeaderDgv\myMultiColHeaderDgv\Properties
目录 0 2008-10-13 10:12 myMultiColHeaderDgv\myMultiColHeaderDgv\bin
目录 0 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest\Properties
目录 0 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest\bin
目录 0 2008-10-13 10:12 myMultiColHeaderDgv\myMultiColHeaderDgv
目录 0 2008-10-13 10:16 myMultiColHeaderDgv\MultiColHeaderDgvTest
目录 0 2008-10-13 10:12 myMultiColHeaderDgv
----------- --------- ---------- ----- ----
137536 27
............此处省略0个文件信息
- 上一篇:c#飞机订票系统sql
- 下一篇:C#.Net实现各种形状的Panel控件
相关资源
- winform 等待窗体 gif动画等待
- c# winform usercontrol用户控件传值
- Q757416.zip VB.NET WinForms 如何让label中的
- winform自定义滚动条
- Winform MessageBox 自定义设计样式
- .net winform自动升级
- Datagridview分页控件
- winform 自定义日期控件--(201903)
- winform跨界面传值
- RegexTextBox可验证文本框(.net c# winfo
- 仿QQ面板的WinForm窗体源代码
- C#_winform操作excel(打开、内嵌)
- C# winform 三层架构设计登陆小模块演示
- winform高效率的分页查询
- C#窗体程序对数据库的增删改查操作三
-
C# winform实现combox绑定xm
l实现级联数 - C#调用matlab画图,解决图像嵌入Winfo
- c#写的winform超级记事本
- c# DataGridView中添加下拉列表
- C# Winform数值实时曲线完整
- Winform天气预报WebService根据IP地址自动
- C#图形界面汉诺塔Hanoi
- ZY_winform创建不规则窗体和控件源码
- 树形列表控件CSharp,WinForm
- C# Winform,FX3U-32M,FX3u-ENET-ADP,MC协议
- c#datagridview小票打印单据存储
- Winform 画多边形
- C# winform Socket 即时通讯
- C# winform 单击与双击事件同时存在
- c#调用winapi实现WinForm中嵌入EXE程序
评论
共有 条评论