回复 1楼fcp0000的帖子
根据你的图片,第一张图片里的三角符号是排序的图片。第二张图片是分组的图片。是Spread的不同的功能。
Sort排序的功能,需要需要排序列的AllowAutoSort设置为true。然后排序的三角符号可以通过SetImage自己定义。
代码参考:
- FarPoint.Win.Spread.SpreadView wrkbk = fpSpread1.GetRootWorkbook();
- wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.SortAscendingImage, Image.FromFile("D:\\up.bmp"));
- wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.SortAscendingImageDisabled, Image.FromFile("D:\\up-dis.bmp"));
- wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.SortDescendingImage, Image.FromFile("D:\\down.bmp"));
- wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.SortDescendingImageDisabled, Image.FromFile("D:\\down-dis.bmp"));
- wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.SortUnsortedImage, Image.FromFile("D:\\unsort.bmp"));
- wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.SortUnsortedImageDisabled, Image.FromFile("D:\\unsort-dis.bmp"));
- Random r = new Random();
- int i, j = 0;
- for (i = 0; i <= 7; i++)
- for (j = 0; j<= 7; j++)
- {
- fpSpread1.ActiveSheet.SetValue(i, j, r.Next().ToString());
- }
- fpSpread1.ActiveSheet.Columns[0].AllowAutoSort = true;
- Image indicator;
- indicator = wrkbk.GetImage(4);
- pictureBox1.Image = indicator;
复制代码 |