第二个问题,可以参考以下代码:
- protected override void Render(HtmlTextWriter writer)
- {
- Table table = FpSpread1.FindControl("viewport") as Table;
- for (int row = 0; row < table.Rows.Count; row++)
- {
- for (int col = 0; col < table.Rows[row].Cells.Count; col++)
- {
- if (!string.IsNullOrWhiteSpace(FpSpread1.ActiveSheetView.Cells[row, col].Text))
- {
- table.Rows[row].Cells[col].Attributes.Add("title", FpSpread1.ActiveSheetView.Cells[row, col].Text);
- }
- }
- }
- base.Render(writer);
- }
复制代码 |