GridView合并单元格的简单方法

Labview_Note_2 Labview_Note2 阅读详情



 1     string _tempvalue="";
 2     int _temprowspan = 1;
 3     TableCell _temptablecell=null;
 4 
 5     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 6     {
 7 
 8         if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Footer)
 9         {
10             if (e.Row.Cells[0].Text == _tempvalue)
11             {
12                 _temprowspan++;
13                 e.Row.Cells.Remove(e.Row.Cells[0]);
14             }
15             else
16             {
17                 if (_temprowspan != 1)
18                     _temptablecell.RowSpan = _temprowspan;
19 
20                 _tempvalue = e.Row.Cells[0].Text;
21                 _temptablecell = e.Row.Cells[0];
22                 _temprowspan = 1;
23             }
24         }
25     }

 

 在此例中的方法是:若单元格重复,则删除此单元格,并设置未重复的第一个单元格的RowSpan为跨度包含的重复数。


GridView 合并单元格(多列)及特定条件的数据高亮显示实现 效果图如下:  代码: Tim Demo 演示 <asp:GridView ID="GridView1" runat="server" onrowdatabound="GridView1_RowDataBound"> 后台: using System; us 阅读详情

相关推荐

Labview 合并Excel多单元格

Labview 合并Excel多单元格 1-可合并表头,多方面合并,与手工操作一致,批量执行

合并excle

................................

l960311412的博客 527

LabVIEW表格插入组合框

LabVIEW表格插入组合框

Labview生成报告之如何将数据放置到固定的Word模板里

接触Labview多了之后,我们都知道在程序进行完采集、识别后,要将所得到的数据放在要求的固定Word或Excel模板中,关于这部分内容,网上的资源少之又少,我也苦恼了很久,由于项目中有这方面的要求,后面没办法还是靠自己摸索,花费了一些时间,还好小有收获。

qq_60942249的博客 3696

表格自动匹配处理.exe

由于部分工作需要统计与挑选人数已签到人数,所以开发此软件。 可挑选输入文件与库文件,将输入文件与库文件进行匹配,输出一个新文件,其中的数据为库文件,当输入文件与库文件匹配时,在表格第二列置1

devexpress实现单元格合并以及依据条件合并单元格

1、devexpress实现单元格合并非常的简单,只要设置属性【AllowCellMerge=True】就可以了,实现效果如下图: 2、但是在具体要求中并非需要所有的相同单元格都合并,可能需要其他的条件来控制合并。这个时候我们就需要在事件gridView1_CellMerge中来控制了。下图为根据最后一列判断是否合并单元格的效果图(其中第四列设置为不合并,这里只是为了达到一个比较效果。)。

kehaigang29的专栏 1万+

从ARM转战TI DSP:手把手教你用CCS 10.1.1搭建F280049C的第一个工程(含CMD文件避坑指南)

本文详细介绍了从ARM开发转向TI DSP(TMS320F280049C)的完整流程,包括CCS 10.1.1开发环境配置、工程搭建、CMD文件避坑指南以及外设开发实战。特别针对ARM开发者常见的DSP特性差异问题提供了解决方案,帮助初学者快速入门DSP开发。

weixin_42536058的博客 373

调拨代码汇总

一、合并单元格 privateDataTableCreateDataTable(){DataTabledt=newDataTable();dt.Columns.Add("Year");dt.Columns.Add("Term");dt.Columns.Add("...

weixin_30954607的博客 167

PX4开发环境搭建(Ubuntu1804+QGC+Qt Creator )

文章目录前言一、安装环境二、PX4环境搭建1. 在虚拟机中安装Ubuntu2. 安装PX4环境(1)下载PX4源码:(2) 安装工具链(3) jMAVSim仿真(4) 编译验证三、安装QGC四、安装Qt Creator 前言 在这之前作者完全没接触过PX4,安装过程遇到了很多坑,而且每安装下载一个东西都要等好久,出现问题又要重新开始,前后折腾了四天才弄好,希望此文对大家有所帮助。 一、安装环境 ...

Beyonderwei的博客 9023

26版SPSS操作教程(高级教程第十章)

#大道之行,在于坚持 #本期内容:二分类Logistic回归模型 #由于导师最近布置了学习SPSS这款软件的任务,因此想来平台和大家一起交流下学习经验,这期推送内容接上一次高级教程第九章的学习笔记,希望能得到一些指正和帮助~

你好! 1599

GridView合并单元格(已更新)

最近做项目时遇到一个需求----GridView合并单元格,需求结果如下图所示:     在网上找了很多资料,大多是一篇文章转载的,他们的方法貌似只能实现对某一列进行单独合并,合并效果类似下图:   显然,上图的合并结果并不符合实际需要, 栏位2应该是在栏位1

Kite0212的专栏 1152

Qt版Dalsa线扫相机的采集Demo

Qt Dalsa

追赶时代的博客 605

GridView合并单元格

gridView合并单元格#region 合并单元格 合并某一行的所有列  ///     ///  合并GridView中某行相同信息的行(单元格)  ///     ///  GridView对象   ///  需要合并的行  public static void GroupRow(GridView GridView1, int rows)  {  TableCell oldTc = Grid

顺着河流 3833

python-pandapower电力系统潮流计算(算例8:ieee33节点潮流计算))

python-pandapower电力系统潮流计算(算例8:ieee33节点潮流计算))

总裁余(余登武)博客 5033

华为OD机试双机位C卷-简单的解压缩算法(C/C++/Py/Java/Js/Go)

华为OD机试(机考)双机位C卷 【简单的解压缩算法】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD真题【简单的解压缩算法】。

qq_45776114的博客 476

C# GridView 合并单元格

C# GridView 合并单元格采用什么方法好?迭代?for语句? table:      SNAME      CNAME      GRADE                AA              English      37                AA              English      49                AA

zhijianliuyanxiang的专栏 2354

2025华为od机试真题B卷【停车场费用统计】Python实现

2025华为od机试真题B卷【停车场费用统计】Python实现

MISAYAONE的博客 538

GridView中合并单元格

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Web.UI.WebControls; /// ///GridViewMergeCell 合并GridView liyang 20090916 //

寒皑释融的专栏 757

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

ASP.NET GridView 实现课程表显示(动态合并单元格)

GridView,ASP.NET中很常用的数据显示控件,这里,我将用这个控件来实现课程表的显示。首先说说课程表的显示与普通记录的显示有何不同?这里所说的普通记录是指直接从数据库中查询出来的、没有经过任何处理的记录。通常,我们用GridView显示这些普通记录,只需直接将这些记录表绑定到GridView中即可。但是,课程表的显示可不是这么简单,它需要将普通记录继续加工,需要根据记录中具体的数据来确定

梦想起飞的地方,必须用心去经营 4164

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

gridView中合并单元格

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Web.UI.WebControls; /// ///GridViewMergeCell 合并GridView liyang 20090916 //

Pro_monkey的专栏 626

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Dev GridView Winform 横竖合并单元格

参考:http://bbs.youkuaiyun.com/topics/390692607源码下载地址:下载以下源码:待合并单元格对象using System;using System.Collections.Generic;using System.Linq;using System.Text;using DevExpress.XtraGrid.Columns;namespace MyUtil{ pu

功夫再高也怕菜刀 充分体现了科技的力量 4533
上一篇: SQL——行转列,列转行
下一篇: linux进入图形界面的方法
Mevin
博客等级 码龄18年 27粉丝 3原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值