DataGridView使用技巧(集)

C# DataGridView合并单元格 private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0 && e.Value.ToString() != string.Empty) { //if (!s. 阅读详情

DataGridView使用技巧大全

收集一些在DataGridVeiw使用技巧,备用。

一、DataGridView 单元格验证

1、定义单元格验证
要求:验证错误后焦点不离开。
实现:
单元格的验证可以使用dgv_details_CellValidating事件。
验证不通过时调用e.Cancel = true;终止事件链,单元格将保持编辑状态。
调用dgv_details.CancelEdit();可以使单元格的内容会滚到修改前的值。
使用System.Windows.Forms.SendKeys.Send("^a");将全选单元格的内容。

2、单元格选中并开始编辑状态
实现:

  1. //DataGridView获得焦点
  2. dgv_details.Focus();
  3. //DataGridView指定当前单元格
  4. dgv_details.CurrentCell = dgv_details[0, 0];
  5. //开始编辑状态
  6. dgv_details.BeginEdit(false);

3、定制自动生成绑定了列
实现:

  1. dgv_details.AutoGenerateColumns = false;

4、设置列的背景色
实现:

    • Color GridReadOnlyColor = Color.LightGoldenrodYellow;
    • dgv_details.Columns[1].DefaultCellStyle.BackColor = WinKeys.GridReadOnlyColor;

5、DataGridView单元格验证的设计的问题
问题:绑定还是不绑定?
1)绑定的优势:比较简单,代码少。
2)绑定得缺点:DataGridView中的数据受数据源的影响(主键约束、值类型约束)。不一至时会激发DataError事件,输入的内容无法保存到单元格中和数据源中。特殊的验证(比如长度、格式等)还是需要另外写代码实现。
关于增加行的问题。增加新行时多主键的验证有问题,而且验证不通过时会将新行全部删除。限制很多,很不方便。
3)非绑定的优势:验证等处理比较灵活。不受数据源的约束。
4)非绑定得缺点:显示和向数据库更新数据时需要比较多的代码实现,效率比较低。
5)总的感觉在处理验证比较麻烦的场合,我还是比较喜欢非绑定的方式。如果数据量大,验证比较简单的场合使用绑定模式比较好。

二、DataGridView重绘代码

1、CellFormatting事件,一般重绘单元格属性。

  1.    private Bitmap highPriImage;
  2.     private Bitmap mediumPriImage;
  3.     private Bitmap lowPriImage;
  4. private void dataGridView1_CellFormatting(object sender, 
  5.         System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
  6.     {
  7.         // Set the background to red for negative values in the Balance column.
  8.         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("Balance"))
  9.         {
  10.             Int32 intValue;
  11.             if (Int32.TryParse((String)e.Value, out intValue) && 
  12.                 (intValue < 0))
  13.             {
  14.                 e.CellStyle.BackColor = Color.Red;
  15.                 e.CellStyle.SelectionBackColor = Color.DarkRed;
  16.             }
  17.         }
  18.         // Replace string values in the Priority column with images.
  19.         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("Priority"))
  20.         {
  21.             // Ensure that the value is a string.
  22.             String stringValue = e.Value as string;
  23.             if (stringValue == null) return;
  24.             // Set the cell ToolTip to the text value.
  25.             DataGridViewCell cell = dataGridView1[e.ColumnIndex, e.RowIndex];
  26.             cell.ToolTipText = stringValue;
  27.             // Replace the string value with the image value.
  28.             switch (stringValue)
  29.             {
  30.                 case "high":
  31.                     e.Value = highPriImage;
  32.                     break;
  33.                 case "medium":
  34.                     e.Value = mediumPriImage;
  35.                     break;
  36.                 case "low":
  37.                     e.Value = lowPriImage;
  38.                     break;
  39.             }
  40.         }
  41.     }

2、CellPainting事件,一般用于合并单元格用
Windows Forms DataGridView 没有提供合并单元格的功能,要实现合并单元格的功能就要在CellPainting事件中使用Graphics.DrawLine和 Graphics.DrawString 自己来“画”。
下面的代码可以对DataGridView第1列内容相同的单元格进行合并:

  1. #region"合并单元格的测试"
  2. private int? nextrow = null;
  3. private int? nextcol = null;
  4. private void dataGridView1_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
  5. {
  6.     if (this.dataGridView1.Columns["description"].Index == e.ColumnIndex && e.RowIndex >= 0)
  7.     {
  8.         if (this.nextcol != null & e.ColumnIndex == this.nextcol)
  9.         {
  10.             e.CellStyle.BackColor = Color.LightBlue;
  11.             this.nextcol = null;
  12.         }
  13.         if (this.nextrow != null & e.RowIndex == nextrow)
  14.         {
  15.             e.CellStyle.BackColor = Color.LightPink;
  16.             this.nextrow = null;
  17.         }
  18.         if (e.RowIndex != this.dataGridView1.RowCount - 1)
  19.         {
  20.             if (e.Value.ToString() == this.dataGridView1.Rows[e.RowIndex + 1].Cells[e.ColumnIndex].Value.ToString())
  21.             {
  22.                 e.CellStyle.BackColor = Color.LightPink;
  23.                 nextrow = e.RowIndex + 1;
  24.             }
  25.         } 
  26.     }
  27.     if (this.dataGridView1.Columns["name"].Index == e.ColumnIndex && e.RowIndex >= 0)
  28.     {
  29.         if (e.Value.ToString() == this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value.ToString())
  30.         {
  31.             e.CellStyle.BackColor = Color.LightBlue;
  32.             nextcol = e.ColumnIndex + 1;
  33.         }
  34.     }
  35. }
  36. //==========================
  37.        
  38. //绘制单元格
  39. private void dataGridView1_CellPainting(object sender, System.Windows.Forms.DataGridViewCellPaintingEventArgs e)
  40. {
  41.     //纵向合并
  42.     if (this.dataGridView1.Columns["description"].Index == e.ColumnIndex && e.RowIndex >= 0)
  43.     {
  44.         using (
  45.             Brush gridBrush = new SolidBrush(this.dataGridView1.GridColor),
  46.             backColorBrush = new SolidBrush(e.CellStyle.BackColor))
  47.         {
  48.             using (Pen gridLinePen = new Pen(gridBrush))
  49.             {
  50.                 // 擦除原单元格背景
  51.                 e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
  52.                 ////绘制线条,这些线条是单元格相互间隔的区分线条,
  53.                 ////因为我们只对列name做处理,所以datagridview自己会处理左侧和上边缘的线条
  54.                 if (e.RowIndex != this.dataGridView1.RowCount - 1)
  55.                 {
  56.                     if (e.Value.ToString() != this.dataGridView1.Rows[e.RowIndex + 1].Cells[e.ColumnIndex].Value.ToString())
  57.                     {
  58.                         e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1,
  59.                         e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);//下边缘的线
  60.                         //绘制值
  61.                         if (e.Value != null)
  62.                         {
  63.                             e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  64.                                 Brushes.Crimson, e.CellBounds.X + 2,
  65.                                 e.CellBounds.Y + 2, StringFormat.GenericDefault);
  66.                         }
  67.                     }
  68.                 }
  69.                 else
  70.                 {
  71.                     e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1,
  72.                         e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);//下边缘的线
  73.                     //绘制值
  74.                     if (e.Value != null)
  75.                     {
  76.                         e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  77.                             Brushes.Crimson, e.CellBounds.X + 2,
  78.                             e.CellBounds.Y + 2, StringFormat.GenericDefault);
  79.                     }
  80.                 }
  81.                 //右侧的线
  82.                 e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1,
  83.                     e.CellBounds.Top, e.CellBounds.Right - 1,
  84.                     e.CellBounds.Bottom - 1);
  85.                 e.Handled = true;
  86.             }
  87.         }
  88.     }
  89.     //横向合并
  90.     if (this.dataGridView1.Columns["name"].Index == e.ColumnIndex && e.RowIndex >= 0)
  91.     {
  92.         using (
  93.             Brush gridBrush = new SolidBrush(this.dataGridView1.GridColor),
  94.             backColorBrush = new SolidBrush(e.CellStyle.BackColor))
  95.         {
  96.             using (Pen gridLinePen = new Pen(gridBrush))
  97.             {
  98.                 // 擦除原单元格背景
  99.                 e.Graphics.FillRectangle(backColorBrush, e.CellBounds);
  100.                 if (e.Value.ToString() != this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value.ToString())
  101.                 {
  102.                     //右侧的线
  103.                     e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, e.CellBounds.Top,
  104.                         e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);
  105.                     //绘制值
  106.                     if (e.Value != null)
  107.                     {
  108.                         e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  109.                             Brushes.Crimson, e.CellBounds.X + 2,
  110.                             e.CellBounds.Y + 2, StringFormat.GenericDefault);
  111.                     }
  112.                 }
  113.                 //下边缘的线
  114.                 e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1,
  115.                                             e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);
  116.                 e.Handled = true;
  117.             }
  118.         }
  119.     }
  120. }
  121. #endregion

三、在GridView中如何格式化Money型字段(downmoon)?

  1.         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="PKID"
  2.             DataMember="DefaultView" DataSourceID="SqlDataSource1">
  3.             <Columns>
  4.                 <asp:BoundField DataField="PKID" HeaderText="PKID" InsertVisible="False" ReadOnly="True"
  5.                     SortExpression="PKID" />
  6.                 
  7.                 <asp:TemplateField>
  8.                         <HeaderTemplate>
  9.                            amount</HeaderTemplate>
  10.                         <ItemTemplate>
  11.                             <asp:Label ID="txtMoney" Text='<%# Decimal.Parse(DataBinder.Eval(Container.DataItem,"amount").ToString())%>' runat="server" />
  12.                         </ItemTemplate>
  13.                     </asp:TemplateField>
  14.                 <asp:BoundField DataField="TestID" HeaderText="TestID" SortExpression="TestID" />
  15.                 <asp:BoundField DataField="testString" HeaderText="testString" SortExpression="testString" />
  16.             </Columns>
  17.         </asp:GridView>

这段代码中,
amount为Money型字段,无论如何只能显示成
1234.5600 
而不能显示成
1,234.56
用

  1. <asp:BoundField DataField="amount" HeaderText="amount" DataFormatString="{0:n2}"  />
  2.                    <asp:BoundField DataField="amount" HeaderText="amount" DataFormatString="{0:c2}"  />

也不行!
后来在MSDN上找到了答案

  1. <asp:BoundField DataField="amount" HeaderText="amount" DataFormatString="{0:#,###.00}"  HtmlEncode="False" />

关键在于HtmlEncode="False"

http://blogs.msdn.com/danielfe/archive/2006/02/08/527628.aspx

(源文:http://blog.csdn.net/downmoon/archive/2007/11/01/1860611.aspx)

四、DataGridView合并单元格 编辑单元格

同事的一个项目需要将DataGridView单元格中的内容分不同颜色显示,想了想只有重绘了。
这种方法还可以用做合并单元格。

参考代码:

  1. private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
  2.         {
  3.             if (e.RowIndex == 0 && e.ColumnIndex >= 0)
  4.             {
  5.                 int left = e.CellBounds.Left;
  6.                 int top = e.CellBounds.Top;
  7.                 int right = e.CellBounds.Right;
  8.                 int bottom = e.CellBounds.Bottom;
  9.                 e.Graphics.FillRectangle(new SolidBrush(Color.White), e.CellBounds);
  10.                 e.Handled = true;
  11.                 Brush gridBrush = new SolidBrush(this.dataGridView1.GridColor);
  12.                 Pen gridLinePen = new Pen(gridBrush);
  13.                 e.Graphics.DrawLine(gridLinePen, right - 1,
  14.                            top, right - 1,
  15.                            bottom - 1);
  16.                 e.Graphics.DrawLine(gridLinePen, left,
  17.                            bottom - 1, right,
  18.                            bottom - 1); 
  19.                 Brush b1 = new SolidBrush(Color.Black);
  20.                 e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  21.                                         b1, left + 2,
  22.                                         top + 1, StringFormat.GenericDefault); 
  23.                 Brush b2 = new SolidBrush(Color.Red);
  24.                 e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  25.                                         b2, left + 2,
  26.                                         top + 10, StringFormat.GenericDefault);
  27.             } 
  28.             DataGridViewSelectedCellCollection dgvscc = this.dataGridView1.SelectedCells;
  29.             foreach (DataGridViewCell dgvc in dgvscc)
  30.             {
  31.                     if (e.RowIndex == 0 
  32.                         && e.RowIndex == dgvc.RowIndex 
  33.                         && e.ColumnIndex == dgvc.ColumnIndex)
  34.                     {
  35.                         int left = e.CellBounds.Left;
  36.                         int top = e.CellBounds.Top;
  37.                         int right = e.CellBounds.Right;
  38.                         int bottom = e.CellBounds.Bottom;
  39.                         // 绘制背景,覆盖单元格区域
  40.                         e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(10,36,106)), e.CellBounds);
  41.                         
  42.                         // 绘制边框
  43.                         Brush gridBrush = new SolidBrush(this.dataGridView1.GridColor);
  44.                         Pen gridLinePen = new Pen(gridBrush);
  45.                         e.Graphics.DrawLine(gridLinePen, right - 1,
  46.                                    top, right - 1,
  47.                                    bottom - 1);
  48.                         e.Graphics.DrawLine(gridLinePen, left,
  49.                                    bottom - 1, right,
  50.                                    bottom - 1); 
  51.                         // 绘制文字
  52.                         Brush b1 = new SolidBrush(Color.White);
  53.                         e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  54.                                                 b1, left + 2,
  55.                                                 top + 1, StringFormat.GenericDefault); 
  56.                         Brush b2 = new SolidBrush(Color.White);
  57.                         e.Graphics.DrawString((String)e.Value, e.CellStyle.Font,
  58.                                                 b2, left + 2,
  59.                                                 top + 10, StringFormat.GenericDefault);
  60.                     }
  61.             } 
  62.             e.Handled = true;            
  63.         }

感谢各位作者。

 

 

 

C# DataGridView单元格合并居中 标题 private void D1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { string text = string.Empty; // 对第1,2行相同单元格进行合并 if (e.RowIndex <= 1 && e.ColumnIndex <= D1.Columns.Count - 1 && e.ColumnIndex > 0) 阅读详情

相关推荐

【2019-06-21】C# DataGridView单元格结合

大家好,这是是雨夜,一位刚入行的萌新。刚刚开通了属于自己的CSDN博客。以后会把自己工作上遇到的一些问题都通过博客的方式记录、分享出来,与大家一同探讨进步。 最近公司的需求是要把winform的datagridview的同一字段的相同内容的单元格合并,但是在把datagridview的内容输出到EXCEL时则是未合并的状态。在网上查询了很多资料,绝大部分的做法就是使用datag...

shana13955036039的博客 754

Winform的DataGridView单元格自定义显示(CellPainting)

我们低代码开发平台免费开放后,收到最大的需求就是“单据转换”,主要是我们以前所面对的行业的需求压根没法通过单据转换这样的配置来实现,所以我们一直都是用后台插件的形式处理他们的个性化计算,转换需求。但是免费开放后,面对的都是各种各样的行业,有很多需求用单据转换确实更简单和容易些。所以昨天有朋友看了我们截图后私信想了解下我们图片上的“日期字段”的格式化按钮怎么做的。我们采用了流程化的方式来实现单据转换,同一个单据可以支持多个转换流程,每个流程支持多个转换节点,每个节点完成不同的转换需求,逻辑很合理。

老田低代码 2773

【VB.net】DataGridView控件的使用

VS中的DataGridView控件,在机房重构里的出镜率还是很高哒~这篇博客就把一些有关DataGridView 控件的一些使用细节和大家分享一下!   找到控件:                                                                                                

王璐 2万+

DataGridView 中单元格显示不一样颜色方法

1、DataGridView  中添加CellPainting事件方法 2、在CellPainting函数内部进行重绘

wangdaoyin2010的专栏 8104

SAP 发货在途库存管理:POD确认差异下的2种后续调整方案对比

本文详细解析了SAP发货在途库存管理中POD确认差异后的财务调整方案,对比了移动类型417和555 T两种处理方式的适用场景及财务影响。通过实际案例说明如何优化POD流程,减少库存差异损失,提升供应链管理效率。特别适合SAP SD模块用户及供应链管理人员参考。

chiman6219的博客 405

Hypermesh二次开发实战:Tcl命令分类与常用函数详解(附避坑指南)

本文深入解析Hypermesh二次开发中Tcl命令的三大核心类别:界面命令、查询命令与修改命令。重点剖析了*createmark集合管理与hm_getvalue信息查询等关键函数的实战用法,并提供了避免Mark覆盖、生命周期管理等常见陷阱的实用指南,旨在帮助CAE工程师构建高效可靠的自动化前处理流程。

weixin_29233333的博客 245

dataGridView使用技巧

1、错误提示:当前进程正另一个进程冲突了。原因是你的程序之前没有正常关闭,导致出现僵尸进程。必须用任务管理器将这个僵尸进程杀掉、结束才行 2、编程的时候所有文件夹、变量、命名空间、项目名称一定要使用英文、拼音 来命名。否则一出现问题很难处理。严禁直接使用汉字、数字来命名 3、要充分利用好VS的代码提示功能 。 4、DBHelper会使程序非常简单 ,里面只有5个方法(1个方法用来连接数据库、1个方法用来执行增删改的sql语句、3个方法用来执行查询(读取器、适配器返回的是DataTabel、聚合函

lelexingyu的博客 2015

海量Embedding进行相似度查询和比较的方法

这个是在科研中的现实需求。例如每一个源代码文件,我们可以生成一个embedding,如果有超过5000万个embedding(例如用BERT生成5000万个embedding),怎么样有效地计算相似性呢(例如有5000个positive的embedding,想在5000万个中找到类似的)。 简单介绍一下我尝试的结果:如果直接用torch.cosine_similarity,我手里的数据估计至少要处理两个月。这时候就想到了用LSH -- Locality Sensitive Hashing,但是我之前并没怎

qysh123的专栏 4569

DataGridView使用技巧

收集一些在DataGridVeiw使用技巧,备用。 一、DataGridView 单元格验证 1、定义单元格验证 要求:验证错误后焦点不离开。 实现: 单元格的验证可以使用dgv_details_CellValidating事件。 验证不通过时调用e.Cancel = true;终止事件链,单元格将保持编辑状态。 调用dgv_details.CancelEdit

hduzh的专栏 1530

解构LOL数值平衡:从基础公式到实战决策的深层逻辑

本文深入解析了《英雄联盟》数值平衡的底层逻辑,从基础攻击力公式到经济系统设计,揭示了MOBA游戏背后的精密数学架构。通过实战案例展示护甲减伤、技能伤害建模等核心机制,探讨装备定价与战斗节奏的数值关联,帮助玩家理解版本更新中的平衡艺术。

weixin_42540248的博客 355

Win10系统VS2019+Cmake+qhull_8.0.0环境配置

1 qhull 1.1 简要介绍 qhull是一个强大的计算几何库,可以用于计算高维的convex hull, Delaunay triangulation, Voronoi diagram等。 1.2 依赖库 qhull不依赖其他库。 1.3 源码包下载 qhull源码地址:github:https://github.com/qhull/qhull.git 2 Cmake构建项目 2.1 路径 源代码路径:D:/ThirdParty/qhull/qhull_8.0.0构建项目路径:D:/Thi.

wangchenxue的博客 2499

datagridview的使用及小技巧

1、绑定数据SqlDataAdapter objDa = new SqlDataAdapter("SELECT ID , BGQHL , BGHDL, BGXZKD, BGYZMJ, BZ FROM META_BGRule", connect);//connect 是数据库连接串            if (objDa != null)            {                D

NewMap的专栏 1381

STM32 | DMA配置和使用如此简单(超详细)

DMA学习很难吗?其实DMA配置和使用如此简单!本文让你无论在DMA认识和理解上(抽象不抽象都有)还是在DMA配置和使用上有个彻彻底底的认识。文章包括寄存器和库函数讲解,省去你自行翻阅使用手册和固件库手册,点到点教会你DMA的配置和使用。

。。。 7万+

C#中dataGridView用法集

最近用到数据库的DataGridView控件 从网上转载了这篇文章看看还是很有帮助的 SqlConnection conn = new SqlConnection('Server=(local);DataBase=test;User=sa;Pwd=sa'); SqlDataAdapter da = new SqlDataAdapter('select * from test', conn); DataSet ds = new DataSet(); da.Fill(ds); dataGridView1.Dat

sc20031024的博客 7469

4、高光图像滤镜显著改善文本图像的光学字符识别

本文介绍了高光图像滤镜在光学字符识别(OCR)中的应用,详细探讨了其技术原理、实现步骤和在多种场景下的效果。通过增强文本图像的边缘和对比度,高光滤镜显著提升了OCR的识别率,尤其适用于扫描文档、手写笔记和低质量图像。实验结果表明,该方法在不同类型的文本图像中均表现出色,并提出了未来优化方向,如深度学习集成和多模态融合,为OCR技术的发展提供了新的可能性。

ooo22的博客 97

SQL中的时间计算:员工每日工作时长

摘要:本文介绍了一个使用SQL查询计算员工每日工作时长的实用方法。通过分析包含员工打卡记录的数据库表,利用CTE(公共表表达式)将日期分组,计算最早和最晚打卡时间差,最终以"小时:分钟"格式输出工作时长。该方法适用于每日两次打卡的场景,并提示了处理漏打卡等特殊情况时的注意事项,为企业考勤管理提供了有效的数据支持方案。(148字)

m0_74337424的博客 413

DataGridView的几个技巧

DataGridView是一个强大而灵活的数据显示编辑控件.网上流传着大量简单而且实用的于DataGridView有关的开发技巧.不过,要从纷繁杂乱的网络资源中筛选出自己真正需要的也并不是一件省心省力的事.因此,这里将平时常用的几个DataGridView技巧整理出来,供有需要的朋友参考. 先用图片来说明本文将要涉及到的相关技巧吧: 一,数据列计数与汇总的计算 还是先看一

Lucker's PowerSpace 3259

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

把一个DATAGRIDVIEW中的行复制到另个DATAGRIDVIEW中

 本人最近编程,需要把一个DATAGRIDVIEW中的数据复制到另一个DATAGRIDVIEW中,经过三天的研究,终于有了一个自己满意的解决办法,现在写出来给大家分享一下。首先让大家看看界面:然后定义一个数据库连接的方法和一个数据库连接对象:private SqlConnection con;        public SqlConnection Conn()  

zhangyu1428_hi的专栏 5928

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

DataGridview一些技巧总结

 最近一直跟DataGridView打交道,突然觉得很多技巧性的东西很模糊,经过最近的个人实验操作和从网上查到的资料把对DataGridView操作的一些技巧总结和借鉴了一下,总结如下:1、自定义列   Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Th

408

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

for foreach遍历datagridview行集不一样

3.遍历DataGridView行集:用foreach和用for来遍历DataGridView行集的效果是不一样的。区别在于,用foreach,会遍历到用foreach的Header,而用用for来遍历却不会。

sclxf的专栏 3313

DataGridView的一些技巧

DataGridView的一些技巧最近一直跟DataGridView打交道,突然觉得很多技巧性的东西很模糊,经过最近的个人实验操作和从网上查到的资料<br />把对DataGridView操作的一些技巧总结和借鉴了一下,总结如下:<br /><br />1、自定义列   Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their    Behavior and Appearance    H

lulugl的专栏 333
上一篇: 常用SQL语句实例大全(含过滤及删除重复数据、导入导出数据等)
下一篇: Visual C# 中智能提示(XML注释)的使用(含注释在开发时显示换行)
wonsoft
博客等级 码龄23年 228粉丝 98原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址