PowerTools SPREAD for ASP.NET 8.0J
Sheet プロパティ (PreviewRowTemplateContainer)

シートを取得します。
構文
'Declaration
 
Public ReadOnly Property Sheet As SheetView
public SheetView Sheet {get;}

プロパティ値

シートを含むSheetView
次のサンプルコードは、プレビュー行とプレビュー行テンプレートコンテナーを設定します。
FarPoint.Web.Spread.Background bg = new FarPoint.Web.Spread.Background();
bg.SelectedBackgroundImageUrl = "picture/Winter.jpg";
bg.BackgroundImageUrl = "picture/Image.bmp";
FarPoint.Web.Spread.Border bd1 = new FarPoint.Web.Spread.Border();
bd1.BorderColor = System.Drawing.Color.Blue;
bd1.BorderStyle = System.Web.UI.WebControls.BorderStyle.Dashed;

FpSpread1.ActiveSheetView.PreviewRowColumnIndex = 0;
FpSpread1.ActiveSheetView.PreviewRowStyle.BackColor = Color.Pink;
FpSpread1.ActiveSheetView.PreviewRowStyle.Background = bg;
FpSpread1.ActiveSheetView.PreviewRowStyle.Border = bd1;
FpSpread1.ActiveSheetView.PreviewRowStyle.CssClass = "CssStyle1";
FpSpread1.ActiveSheetView.PreviewRowStyle.Font.Bold = true;
FpSpread1.ActiveSheetView.PreviewRowStyle.Font.Name = "Aharoni";
FpSpread1.ActiveSheetView.PreviewRowStyle.ForeColor = Color.Blue;
FpSpread1.ActiveSheetView.PreviewRowStyle.HorizontalAlign =  HorizontalAlign.Center;
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Bottom = 10;
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Left = 10;
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Right = 10;
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Top = 10;
FpSpread1.ActiveSheetView.PreviewRowStyle.TabStop = false;
FpSpread1.ActiveSheetView.PreviewRowStyle.VerticalAlign = VerticalAlign.Middle;
 FpSpread1.ActiveSheetView.PreviewRowVisible = true;

// for PreviewRowTemplate, in this case we need to create one Web User Control with name: PreviewRowTemplate, 
// suppose that we have one listbox in the page of Web User Control, then we can add following code in the Page_Load()
PreviewRowTemplateContainer c = this.Parent as PreviewRowTemplateContainer;
if (c != null)
{
    this.ListBox1.Items.Clear();
    for (int col = 0; col < c.Sheet.ColumnCount; col++)
    {
             this.ListBox1.Items.Add(c.Sheet.Cells[c.RowIndex, col].Text);
    }
}

//in your page, you can run this code to load that template in the preview row
FpSpread1.ActiveSheetView.PreviewRowTemplate =     LoadTemplate("PreviewRowTemplate.ascx");
FpSpread1.ActiveSheetView.PreviewRowVisible = true;
Dim bg As New FarPoint.Web.Spread.Background()
bg.SelectedBackgroundImageUrl = "picture/Winter.jpg"
bg.BackgroundImageUrl = "picture/Image.bmp"
Dim bd1 As New FarPoint.Web.Spread.Border()
bd1.BorderColor = System.Drawing.Color.Blue
bd1.BorderStyle = System.Web.UI.WebControls.BorderStyle.Dashed

FpSpread1.ActiveSheetView.PreviewRowColumnIndex = 0
FpSpread1.ActiveSheetView.PreviewRowStyle.BackColor = Color.Pink
FpSpread1.ActiveSheetView.PreviewRowStyle.Background = bg
FpSpread1.ActiveSheetView.PreviewRowStyle.Border = bd1
FpSpread1.ActiveSheetView.PreviewRowStyle.CssClass = "CssStyle1"
FpSpread1.ActiveSheetView.PreviewRowStyle.Font.Bold = True
FpSpread1.ActiveSheetView.PreviewRowStyle.Font.Name = "Aharoni"
FpSpread1.ActiveSheetView.PreviewRowStyle.ForeColor = Color.Blue
FpSpread1.ActiveSheetView.PreviewRowStyle.HorizontalAlign = HorizontalAlign.Center
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Bottom = 10
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Left = 10
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Right = 10
FpSpread1.ActiveSheetView.PreviewRowStyle.Margin.Top = 10
FpSpread1.ActiveSheetView.PreviewRowStyle.TabStop = False
FpSpread1.ActiveSheetView.PreviewRowStyle.VerticalAlign = VerticalAlign.Middle
FpSpread1.ActiveSheetView.PreviewRowVisible = True

' for PreviewRowTemplate, in this case we need to create one Web User Control with name: PreviewRowTemplate,
' suppose that we have one listbox in the page of Web User Control, then we can add following code in the Page_Load()
Dim c As PreviewRowTemplateContainer = TryCast(Me.Parent, PreviewRowTemplateContainer)
If c IsNot Nothing Then
    Me.ListBox1.Items.Clear()
    For col As Integer = 0 To c.Sheet.ColumnCount - 1
        Me.ListBox1.Items.Add(c.Sheet.Cells(c.RowIndex, col).Text)
    Next
End If

'in your page, you can run this code to load that template in the preview row
FpSpread1.ActiveSheetView.PreviewRowTemplate = LoadTemplate("PreviewRowTemplate.ascx")
FpSpread1.ActiveSheetView.PreviewRowVisible = True
参照

PreviewRowTemplateContainer クラス
PreviewRowTemplateContainer メンバ

 

 


© 2003-2015, GrapeCity inc. All rights reserved.