protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
//SP3以前の実装方法
//Control updateBtn = FpSpread1.FindControl("Update");
//Control cancelBtn = FpSpread1.FindControl("Cancel");
//Control copyBtn = FpSpread1.FindControl("Copy");
//Control cutBtn = FpSpread1.FindControl("Clear");
//Control pasteBtn = FpSpread1.FindControl("Paste");
//SP4以降の実装方法
Control updateBtn = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Update"));
Control cancelBtn = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Cancel"));
Control copyBtn = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Copy"));
Control cutBtn = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Cut"));
Control pasteBtn = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Paste"));
if (updateBtn != null)
{
TableCell tc = (TableCell)updateBtn.Parent;
TableRow tr = (TableRow)tc.Parent;
tr.Cells.Remove(tc);
tc = (TableCell)cancelBtn.Parent;
tr.Cells.Remove(tc);
tc = (TableCell)copyBtn.Parent;
tr.Cells.Remove(tc);
tc = (TableCell)cutBtn.Parent;
tr.Cells.Remove(tc);
tc = (TableCell)pasteBtn.Parent;
tr.Cells.Remove(tc);
}
base.Render(writer);
}
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
'SP3以前の実装方法
'Dim updateBtn As Control = FpSpread1.FindControl("Update")
'Dim cancelBtn As Control = FpSpread1.FindControl("Cancel")
'Dim copyBtn As Control = FpSpread1.FindControl("Copy")
'Dim cutBtn As Control = FpSpread1.FindControl("Clear")
'Dim pasteBtn As Control = FpSpread1.FindControl("Paste")
'SP4以降の実装方法
Dim updateBtn As Control = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Update"))
Dim cancelBtn As Control = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Cancel"))
Dim copyBtn As Control = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Copy"))
Dim cutBtn As Control = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Cut"))
Dim pasteBtn As Control = FpSpread1.FindControl(string.Format("{0}_{1}", FpSpread1.ClientID, "Paste"))
If Not updateBtn Is Nothing Then
Dim tc As TableCell = updateBtn.Parent
Dim tr As TableRow = tc.Parent
tr.Cells.Remove(tc)
tc = cancelBtn.Parent
tr.Cells.Remove(tc)
tc = copyBtn.Parent
tr.Cells.Remove(tc)
tc = cutBtn.Parent
tr.Cells.Remove(tc)
tc = pasteBtn.Parent
tr.Cells.Remove(tc)
End If
MyBase.Render(writer)
End Sub