Form1.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraGrid.Columns;
namespace HorizontalMerging
{
public partial class Form1 : Form
{
MyGridViewHandler ViewHandler = null;
public Form1()
{
InitializeComponent();
ViewHandler = new MyGridViewHandler(gridView1);
}
private DataTable CreateTable(int RowCount)
{
DataTable tbl = new DataTable();
tbl.Columns.Add("Name1", typeof(string));
tbl.Columns.Add("Name2", typeof(string));
tbl.Columns.Add("Name3", typeof(string));
tbl.Columns.Add("Name4", typeof(string));
tbl.Columns.Add("Name5", typeof(string));
for (int i = 0; i < RowCount; i++)
{
if (i == 1)
tbl.Rows.Add(new object[] { String.Format("Name{0}", i), "This is a long long string, which is merged for several columns", "", "", "" });
else if (i == 3)
tbl.Rows.Add(new object[] { String.Format("Name{0}", i), "This is a long long string, which is merged for several columns", "", "", "Text" });
else
tbl.Rows.Add(new object[] { String.Format("Name{0}", i), String.Format("Name{0}", i), String.Format("Name{0}", i), String.Format("Name{0}", i) });
}
return

最低0.47元/天 解锁文章
4460

被折叠的 条评论
为什么被折叠?



