코딩하는코알라/C#

Farpoint spead 디자인 요약

룰루랄라코알라 2022. 12. 27. 08:16

//스크롤바 유/무

1) HorizontalScrollBarPolicy - AsNeeded

2) VerticalScrollBarPolicy - AsNeeded

 

//SplitContainer 분할 거리 

this.splitContainer1.SplitterDistance = 120; 

 

//Margin : 여백설정 

//Dock :바인딩된 컨드롤 테두리 설정 

 

//Sheet 설정 중 

AutoGenerrateColumns : 데이터소스 기반 자동 열생성 (true시 DataSet 기반으로 자동 컬럼 생성 )

DataAutoCellTypes : 바인딩 된 열의 셀에 셀혈식 자동 설정 

DataAutoHeadings : 바인딩된 시트에 열머리글 텍스트가 dataset 필드이름으로 자동 할당 여부

DataAutoSizeColumns : 바인딩시트에 연결된 dataset기준 해당 열크기 자동조절 여부

 

OperationMode : 마우스 키보드 선택 모드 

ColumnCount : 시트에 보여지는 컬럼수

 

FarPoint.Win.Spread.CellType.NumberCellType numberCellType = new FarPoint.Win.Spread.CellType.NumberCellType();
                    numberCellType.DecimalPlaces = 1;
                    numberCellType.MaximumValue = 10000000D;
                    numberCellType.MinimumValue = -10000000D;
                    numberCellType.ShowSeparator = true;
 FarPoint.Win.Spread.CellType.NumberCellType numberCellType2 = new FarPoint.Win.Spread.CellType.NumberCellType();
                    numberCellType2.DecimalPlaces = 2;
                    numberCellType2.MaximumValue = 10000000D;
                    numberCellType2.MinimumValue = -10000000D;
                    numberCellType2.ShowSeparator = true;                
                    
  this.CellType = this.index < 0? numberCellType2 : numberCellType;

 

// 컬럼 고정 하기
this.FrozenColumnCount = 1;

// Row 고정하기
this.FrozenRowCount = 1;

 

// Spread의 선을 안보이게 함
this.HorizontalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);
this.VerticalGridLine = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.None);

 

// 커서를 Spread의 특정 위치로 보내기
this.SetActiveCell(0, 1);
this.FpSpread.SetViewportTopRow(0, pgSheetView.Rows.Count); 
this.FpSpread.SetViewportLeftColumn(0, 0);

// 컬럼 Cell type 수동 조정
using FarPoint.Win.Spread.CellType;

// 컬럼 속성 초기화
Plan.Columns[i].CellType = null;

// 셀타입 정의 (number)
 NumberCellType TestCellType = new NumberCellType();

// Spread를 숫자형으로 선언시 사용
TestCellType.DecimalPlaces = 2;
TestCellType.FixedPoint = true;
TestCellType.Separator = ",";
TestCellType.ShowSeparator = true;
TestCellType.MaximumValue = 999999999999.99;

// 셀타입 할당
pgSSPlan.Columns[i].CellType = TestCellType;

//  컬럼 속성 (텍스트)
using FarPoint.Win.Spread.CellType;

TextCellType pgTextCellType = new TextCellType();
TextCellType.CharacterCasing = CharacterCasing.Upper;
TextCellType.CharacterSet = CharacterSet.Alpha;
TextCellType.MaxLength = 1;

this.Columns[dynamicColIdx].CellType = pgTextCellType ;

//  컬럼 수동 조정 (버튼)
ButtonCellType buttonCellType = new ButtonCellType();

 

// 현재 선택되어져 있는 Row의 컬럼 정보 가져오기
this.GetTextEx(pgSSFileList.ActiveRowIndex, "DocSeq")

// Spread의 Row를 각각 다르게 표현 하고자 할때
using System.Drawing;
this.AlternatingRows.Get(1).BackColor = Color.GhostWhite;


// Spread Sheet 선택 모드
this.OperationMode = FarPoint.Win.Spread.OperationMode.SingleSelect;


// Spread 특정 Row만 색상, 폰트 변경 하기 
this.Rows[i].BackColor = Color.Red;
this.Rows[i].Font = new Font(SSVoc.Font.FontFamily, SSVoc.Font.Size, FontStyle.Bold);

반응형