GridView复合多层表头(不限级)!!! (转)

表头定义说明:
        表头定义方法:相邻父列头之间用'#'分隔,上级行与下级行用空格(' ')分隔,相邻未级子列头用逗号分隔(',').
表头定义示例:
A.两层


烟叶等级#级别#保山市 保山,小计#楚雄州 姚安,小计#大理州 宾川,大理,小计#红河州 建水,泸西,弥勒,石屏,小计#昆明市 富民,禄劝,小计#丽江市 华坪,宁蒗,小计#临沧市 沧源,凤庆,耿马,临翔,双江,永德,云县,镇康,小计#普洱市 景东,思茅,镇沅,小计#曲靖市 富源,陆良,罗平,师宗,宣威,小计#文山州 文山,小计#玉溪市 玉溪,小计#总计
B.三层

 

等级#级别#上期结存 件数,重量,比例#本期调入 收购调入 件数,重量,比例#本期发出 车间投料 件数,重量,比例#本期发出 产品外销百分比 件数,重量,比例#平均值

调用说明:使用时在GridView的RowCreated事件中加入下面代码调用

   

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)Code
GridView复合多层表头(不限级)!!! (转)     if (e.Row.RowType == DataControlRowType.Header)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)            DynamicTHeaderHepler dHelper 
= new DynamicTHeaderHepler();
GridView复合多层表头(不限级)!!! (转)            
string header = "等级#级别#上期结存 件数,重量,比例#本期调入 收购调入 件数,重量,比例#本期发出 车间投料 件数,重量,"
GridView复合多层表头(不限级)!!! (转)                          
+ "比例#本期发出 产品外销百分比 件数,重量,比例#平均值";
GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)            dHelper.SplitTableHeader(e.Row, header);
GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)表头生成类:
GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)
//
GridView复合多层表头(不限级)!!! (转)
//***********************************************************************
GridView复合多层表头(不限级)!!! (转)
//  Created: 2007-10-29    Author:  ruijc
GridView复合多层表头(不限级)!!! (转)
//  File: DynamicTHeaderHepler.cs
GridView复合多层表头(不限级)!!! (转)
//  Description: 动态生成复合表头帮助类
GridView复合多层表头(不限级)!!! (转)
//  相邻父列头之间用'#'分隔,父列头与子列头用空格(' ')分隔,相邻子列头用逗号分隔(',').
GridView复合多层表头(不限级)!!! (转)
//***********************************************************************
GridView复合多层表头(不限级)!!! (转)
using System;
GridView复合多层表头(不限级)!!! (转)
using System.Data;
GridView复合多层表头(不限级)!!! (转)
using System.Configuration;
GridView复合多层表头(不限级)!!! (转)
using System.Web;
GridView复合多层表头(不限级)!!! (转)
using System.Web.Security;
GridView复合多层表头(不限级)!!! (转)
using System.Web.UI;
GridView复合多层表头(不限级)!!! (转)
using System.Web.UI.WebControls;
GridView复合多层表头(不限级)!!! (转)
using System.Web.UI.WebControls.WebParts;
GridView复合多层表头(不限级)!!! (转)
using System.Web.UI.HtmlControls;
GridView复合多层表头(不限级)!!! (转)
using System.Collections.Generic;
GridView复合多层表头(不限级)!!! (转)
using System.Collections;
GridView复合多层表头(不限级)!!! (转)
public class DynamicTHeaderHepler
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)    
public DynamicTHeaderHepler()
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)        
//
GridView复合多层表头(不限级)!!! (转)        
// TODO: Add constructor logic here
GridView复合多层表头(不限级)!!! (转)        
//
GridView复合多层表头(不限级)!!! (转)
    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 重写表头
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="targetHeader">目标表头</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="newHeaderNames">新表头</param>
GridView复合多层表头(不限级)!!! (转)    
/// <remarks>
GridView复合多层表头(不限级)!!! (转)    
/// 等级#级别#上期结存 件数,重量,比例#本期调入 收购调入 件数,重量,比例#本期发出 车间投料 件数,重量,
GridView复合多层表头(不限级)!!! (转)    
/// 比例#本期发出 产品外销百分比 件数,重量,比例#平均值
GridView复合多层表头(不限级)!!! (转)    
/// </remarks>

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    public void SplitTableHeader(GridViewRow targetHeader, string newHeaderNames)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)        TableCellCollection tcl 
= targetHeader.Cells;//获得表头元素的实例
GridView复合多层表头(不限级)!!! (转)
        tcl.Clear();//清除元素
GridView复合多层表头(不限级)!!! (转)
        int row = GetRowCount(newHeaderNames);
GridView复合多层表头(不限级)!!! (转)        
int col = GetColCount(newHeaderNames);
GridView复合多层表头(不限级)!!! (转)        
string[,] nameList = ConvertList(newHeaderNames,row,col);
GridView复合多层表头(不限级)!!! (转)        
int RowSpan = 0;
GridView复合多层表头(不限级)!!! (转)        
int ColSpan = 0;
GridView复合多层表头(不限级)!!! (转)        
for (int k = 0; k < row; k++)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)            
string LastFName = "";
GridView复合多层表头(不限级)!!! (转)            
for (int i = 0; i < col; i++)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                
if (LastFName == nameList[i, k] && k!=row-1)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    LastFName 
= nameList[i, k];
GridView复合多层表头(不限级)!!! (转)                    
continue;
GridView复合多层表头(不限级)!!! (转)                }

GridView复合多层表头(不限级)!!! (转)                
else
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    LastFName 
= nameList[i, k];
GridView复合多层表头(不限级)!!! (转)                }

GridView复合多层表头(不限级)!!! (转)                
int bFlag=IsVisible(nameList, k, i, LastFName);
GridView复合多层表头(不限级)!!! (转)                
switch (bFlag)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    
case 0:
GridView复合多层表头(不限级)!!! (转)                        
break;
GridView复合多层表头(不限级)!!! (转)                    
case 1:
GridView复合多层表头(不限级)!!! (转)                        RowSpan 
= GetSpanRowCount(nameList,row, k, i);
GridView复合多层表头(不限级)!!! (转)                        ColSpan 
= GetSpanColCount(nameList,row,col, k, i);
GridView复合多层表头(不限级)!!! (转)                        tcl.Add(
new TableHeaderCell());//添加表头控件
GridView复合多层表头(不限级)!!! (转)
                        tcl[tcl.Count - 1].RowSpan = RowSpan;
GridView复合多层表头(不限级)!!! (转)                        tcl[tcl.Count 
- 1].ColumnSpan = ColSpan;
GridView复合多层表头(不限级)!!! (转)                        tcl[tcl.Count 
- 1].HorizontalAlign = HorizontalAlign.Center;
GridView复合多层表头(不限级)!!! (转)                        tcl[tcl.Count 
- 1].Text = LastFName;
GridView复合多层表头(不限级)!!! (转)                        
break;
GridView复合多层表头(不限级)!!! (转)                    
case -1:
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                        
string[] EndColName = LastFName.Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)',' });
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                        
foreach(string eName in EndColName)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                            tcl.Add(
new TableHeaderCell());//添加表头控件
GridView复合多层表头(不限级)!!! (转)
                            tcl[tcl.Count - 1].HorizontalAlign = HorizontalAlign.Center;
GridView复合多层表头(不限级)!!! (转)                            tcl[tcl.Count 
- 1].Text = eName;
GridView复合多层表头(不限级)!!! (转)                        }

GridView复合多层表头(不限级)!!! (转)                        
break;
GridView复合多层表头(不限级)!!! (转)                }

GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)            
if (k != row-1)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){//不是起始行,加入新行标签
GridView复合多层表头(不限级)!!! (转)
                tcl[tcl.Count - 1].Text = tcl[tcl.Count - 1].Text+"</th></tr><tr>";
GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 如果上一行已经输出和当前内容相同的列头,则不显示
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="ColumnList">表头集合</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="rowIndex">行索引</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="colIndex">列索引</param>
GridView复合多层表头(不限级)!!! (转)    
/// <returns>1:显示,-1:含','分隔符,0:不显示</returns>

GridView复合多层表头(不限级)!!! (转)    private int IsVisible(string[,] ColumnList,int rowIndex, int colIndex,string CurrName)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
if (rowIndex!=0)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            
if (ColumnList[colIndex,rowIndex-1]==CurrName)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                
return 0;
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                
if (ColumnList[colIndex, rowIndex].Contains(","))
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    
return -1;
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    
return 1;
GridView复合多层表头(不限级)!!! (转)                }

GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)        
return 1;
GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 取得和当前索引行及列对应的下级的内容所跨的行数
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="ColumnList">表头集合</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="row">行数</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="rowIndex">行索引</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="colIndex">列索引</param>
GridView复合多层表头(不限级)!!! (转)    
/// <returns>行数</returns>

GridView复合多层表头(不限级)!!! (转)    private int GetSpanRowCount(string[,] ColumnList, int row,int rowIndex, int colIndex)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)        
string LastName = "";
GridView复合多层表头(不限级)!!! (转)        
int RowSpan = 1;
GridView复合多层表头(不限级)!!! (转)        
for (int k = rowIndex; k < row; k++)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            
if (ColumnList[colIndex,k]==LastName)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                RowSpan
++;
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                LastName 
= ColumnList[colIndex, k];
GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)        
return RowSpan;
GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 取得和当前索引行及列对应的下级的内容所跨的列数
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="ColumnList">表头集合</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="row">行数</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="col">列数</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="rowIndex">行索引</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="colIndex">列索引</param>
GridView复合多层表头(不限级)!!! (转)    
/// <returns>列数</returns>

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    private int GetSpanColCount(string[,] ColumnList,int row, int col,int rowIndex, int colIndex)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)        
string LastName = ColumnList[colIndex, rowIndex] ;
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
int ColSpan = ColumnList[colIndex, row-1].Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)',' }).Length;
GridView复合多层表头(不限级)!!! (转)        ColSpan 
= ColSpan == 1 ? 0 : ColSpan;
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
for(int i=colIndex+1;i<col;i++)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)            
if (ColumnList[i, rowIndex] == LastName)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                ColSpan 
+= ColumnList[i, row - 1].Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)',' }).Length;
GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)            
else
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                LastName 
= ColumnList[i, rowIndex];
GridView复合多层表头(不限级)!!! (转)                
break;
GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)        
return ColSpan;
GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 将已定义的表头保存到数组
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="newHeaders">新表头</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="row">行数</param>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="col">列数</param>
GridView复合多层表头(不限级)!!! (转)    
/// <returns>表头数组</returns>

GridView复合多层表头(不限级)!!! (转)    private string[,] ConvertList(string newHeaders, int row, int col)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
string[] ColumnNames = newHeaders.Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)'#' });
GridView复合多层表头(不限级)!!! (转)        
string[,] news = new string[col, row];
GridView复合多层表头(不限级)!!! (转)        
string Name = "";
GridView复合多层表头(不限级)!!! (转)        
for (int i = 0; i < col; i++)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            
string[] CurrColNames = ColumnNames[i].ToString().Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)' ' });
GridView复合多层表头(不限级)!!! (转)            
for (int k = 0; k < row; k++)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                
if (CurrColNames.Length - 1 >= k)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    
if (CurrColNames[k].Contains(","))
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                        
if (CurrColNames.Length != row)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                        GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                            
if (Name == "")
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                                news[i, k] 
= news[i, k - 1];
GridView复合多层表头(不限级)!!! (转)                                Name 
= CurrColNames[k].ToString();
GridView复合多层表头(不限级)!!! (转)                            }

GridView复合多层表头(不限级)!!! (转)                            
else
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                            GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                                news[i, k 
+ 1= Name;
GridView复合多层表头(不限级)!!! (转)                                Name 
= "";
GridView复合多层表头(不限级)!!! (转)                            }

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                        }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                            news[i, k] 
= CurrColNames[k].ToString();
GridView复合多层表头(不限级)!!! (转)                        }

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                    }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                        news[i, k] 
= CurrColNames[k].ToString();
GridView复合多层表头(不限级)!!! (转)                    }

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                    
if (Name == "")
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)                        news[i, k] 
= news[i, k - 1];
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)                    }
elseGridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)                        news[i, k] 
= Name;
GridView复合多层表头(不限级)!!! (转)                        Name 
= "";
GridView复合多层表头(不限级)!!! (转)                    }

GridView复合多层表头(不限级)!!! (转)                }

GridView复合多层表头(不限级)!!! (转)            }

GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)        
return news;
GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 取得复合表头的行数
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="newHeaders">新表头</param>
GridView复合多层表头(不限级)!!! (转)    
/// <returns>行数</returns>

GridView复合多层表头(不限级)!!! (转)    private int GetRowCount(string newHeaders)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
string[] ColumnNames = newHeaders.Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)'#' });
GridView复合多层表头(不限级)!!! (转)        
int Count = 0;
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
foreach(string name in ColumnNames)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)            
int TempCount = name.Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)' ' }).Length;
GridView复合多层表头(不限级)!!! (转)            
if (TempCount > Count)
GridView复合多层表头(不限级)!!! (转)                Count 
= TempCount;
GridView复合多层表头(不限级)!!! (转)        }

GridView复合多层表头(不限级)!!! (转)        
return Count;
GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    
/**//**//**//// <summary>
GridView复合多层表头(不限级)!!! (转)    
/// 取得复合表头的列数
GridView复合多层表头(不限级)!!! (转)    
/// </summary>
GridView复合多层表头(不限级)!!! (转)    
/// <param name="newHeaders">新表头</param>
GridView复合多层表头(不限级)!!! (转)    
/// <returns>列数</returns>

GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)    private int GetColCount(string newHeaders)GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转){
GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)        
return newHeaders.Split(new char[] GridView复合多层表头(不限级)!!! (转)GridView复合多层表头(不限级)!!! (转)'#' }).Length;
GridView复合多层表头(不限级)!!! (转)    }

GridView复合多层表头(不限级)!!! (转)   
GridView复合多层表头(不限级)!!! (转)}

GridView复合多层表头(不限级)!!! (转)
GridView复合多层表头(不限级)!!! (转)


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/aoeagle/archive/2008/02/20/2108567.aspx

 

 

本文转自温景良(Jason)博客园博客,原文链接:http://www.cnblogs.com/wenjl520/archive/2009/10/11/1580734.html,如需转载请自行联系原作者

 

上一篇:Swift语法专题四——字符串与字符


下一篇:Swift语法专题三——基础运算符