请问你以上改变标题的代码是在Spread 的 ColumnDragMoveCompleted事件中写的吗?
我简单的写了一段代码:
public Form1()
{
InitializeComponent();
fpSpread1.AllowColumnMove = true;
fpSpread1.ActiveSheet.Columns[2].Tag = "Tag";
fpSpread1.ColumnDragMoveCompleted += fpSpread1_ColumnDragMoveCompleted;
}
void fpSpread1_ColumnDragMoveCompleted(object sender, FarPoint.Win.Spread.DragMoveCompletedEventArgs e)
{
if (e.FromIndex == 1 && e.ToIndex == 2)
{
fpSpread1.ActiveSheet.ColumnHeader.Cells[0, 2].Text = fpSpread1.ActiveSheet.Columns[1].Tag.ToString();
}
}
运行以上代码,当把ColumnB移动到ColumnC后,ColumnHeader.Cells[0, 2]中的文本为“Tag”。不知道您的需求和此类似吗? |