回复 1楼yinzhm的帖子
Spread for WinForms 版本可以通过以下放法实现:
- private void Form1_Load(object sender, System.EventArgs e)
- {
- fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Renderer = new myColumnHeaderRenderer();
- fpSpread1.Sheets[0].Columns[0].AllowAutoSort = true;
- fpSpread1.Sheets[0].Columns[0].AllowAutoFilter = true;
- }
- // Define a new column header renderer.
- public class myColumnHeaderRenderer : FarPoint.Win.Spread.CellType.ColumnHeaderRenderer
- {
- public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
- {
- base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor);
- }
- // Override the sorting indicator paint method.
- override public void PaintSortIndicator(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, float zoomFactor)
- {
- //g.DrawImage(new Image(), new Point(0, 0));
- }
- // Override the filtering indicator paint method.
- override public void PaintFilterIndicator(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, float zoomFactor)
- {
- g.FillRectangle(new SolidBrush(Color.Blue), r);
- }
- }
复制代码 |