回复 1楼dgzcit的帖子
通过Spread自定义单元格可以实现类似的效果:
- [Serializable]
- public class CTreeViewCellType : FarPoint.Web.Spread.GeneralCellType
- {
- public override Control PaintCell(string id, TableCell parent, FarPoint.Web.Spread.Appearance style, FarPoint.Web.Spread.Inset margin, object value, bool upperLevel)
- {
- TreeView tree = null;
- tree = new TreeView();
- tree.Font.Size = 15;
- tree.ShowLines = true;
- TreeNode node = new TreeNode("电风扇");
- node.ChildNodes.Add(new TreeNode("风罩"));
- TreeNode node1 = new TreeNode("底座");
- node1.ChildNodes.Add(new TreeNode("底盘"));
- node1.ChildNodes.Add(new TreeNode("铁座"));
- node.ChildNodes.Add(node1);
- node.ChildNodes.Add(new TreeNode("竖杆"));
- tree.Attributes.Add("onclick", "return NodeChanged(this);");
- tree.Nodes.Add(node);
- return tree;
- //return base.PaintCell(id, parent, style, margin, value, upperLevel);
- }
- }
复制代码
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- FpSpread1.ActiveSheetView.AllowPage = false;
- FpSpread1.ActiveSheetView.RowCount = 50;
- FpSpread1.ActiveSheetView.ColumnCount = 5;
- FpSpread1.ActiveSheetView.AddSpanCell(0, 0, 20, 1);
- FpSpread1.ActiveSheetView.Cells[0, 0].CellType = new CTreeViewCellType();
-
- }
- }
复制代码
|