Spread For Asp.net V10
・想做的是:如下图,第5列的列是合并了两行的,想所有的列全部都能实现AutoFilterMode.Enhanced模式下的过滤效果。
还请各位帮忙看看有没有解决的方法。
目前的问题点
・过滤器设置索引在第2行(FpSpread1.ActiveSheetView.ColumnHeaderAutoFilterIndex=1)的时候,对 第5列(ALL那列)不起作用。
但是设在第一行(FpSpread1.ActiveSheetView.ColumnHeaderAutoFilterIndex=0)的话,第2,4列没有过滤按钮。
附上代码
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not (Me.IsPostBack) Then FpSpread1.Width = 500 FpSpread1.Sheets(0).RowCount = 3 FpSpread1.Sheets(0).ColumnCount = 5 ' Set the number or rows and columns in the headers. FpSpread1.Sheets(0).ColumnHeader.RowCount = 2 'Span the header cells as needed. FpSpread1.Sheets(0).ColumnHeaderSpanModel.Add(0, 4, 2, 1) FpSpread1.Sheets(0).ColumnHeaderSpanModel.Add(0, 0, 1, 2) FpSpread1.Sheets(0).ColumnHeaderSpanModel.Add(0, 2, 1, 2) 'Set the labels as needed -- 'using the Label property or the cell Text property. FpSpread1.Sheets(0).ColumnHeader.Cells(0, 0).Text = "1st Quarter" FpSpread1.Sheets(0).ColumnHeader.Cells(0, 2).Text = "2nd Quarter" FpSpread1.Sheets(0).ColumnHeader.Cells(1, 0).Text = "East" FpSpread1.Sheets(0).ColumnHeader.Cells(1, 1).Text = "West" FpSpread1.Sheets(0).ColumnHeader.Cells(1, 2).Text = "East" FpSpread1.Sheets(0).ColumnHeader.Cells(1, 3).Text = "West" FpSpread1.Sheets(0).ColumnHeader.Cells(0, 4).Text = "All" Dim rf As HideRowFilter = New HideRowFilter(FpSpread1.ActiveSheetView) rf.ShowFilterIndicator = True rf.AddColumn(0) rf.AddColumn(1) rf.AddColumn(2) rf.AddColumn(3) rf.AddColumn(4) FpSpread1.ActiveSheetView.RowFilter = rf FpSpread1.ActiveSheetView.AutoFilterMode = AutoFilterMode.Enhanced FpSpread1.ActiveSheetView.ColumnHeaderAutoFilterIndex = 1 End If End Sub
|