본문 바로가기
Winform

Infragistics Grid 멀티 헤더

by 캡틴노랑이 2015. 8. 26.
반응형

Infragistics Grid Header


헤더 텍스트가 길어서 2줄로 표현 해야될 때


//확인 못함 아마 헤더가 한줄일 떄만 적용되는 듯.

grdTab3Upper.DisplayLayout.Bands[0].ColHeaderLines = 2;


그룹핑 되어 있을 때, 멀티라인 적용 할라면

단, 그룹핑 된 다른 열도 2줄이 되어버림.

grdTab3Upper.DisplayLayout.Bands[0].GroupHeaderLines = 2;



//내부 확장 메서드 

grdTab3Upper.SetupColumn();

grdTab3Upper.DisplayLayout.Bands[0].Override.WrapHeaderText = DefaultableBoolean.True;

grdTab3Upper.DisplayLayout.Bands[0].ColHeaderLines = 2;

grdTab3Upper.DisplayLayout.Bands[0].GroupHeaderLines = 2;            

grdTab3Upper.MergeHeader("G0", "Type", new List<string>() { "VesselTypeNM" });

grdTab3Upper.MergeHeader("G1", "Vessel", new List<string>() { "VesselAbbrvNM" });

grdTab3Upper.MergeHeader("G2", "Priority", new List<string>() { "M_PRIORITY_NM" });


grdTab3Upper.MergeHeader("G3", "Good" + Environment.NewLine + "Condition", new List<string>() { "D", "DP" });

grdTab3Upper.MergeHeader("G4", "Inadequate" + Environment.NewLine + " Technical Skill", new List<string>() { "T", "TP" });

grdTab3Upper.MergeHeader("G5", "Shortage" + Environment.NewLine + " of M/H", new List<string>() { "R", "RP" });

grdTab3Upper.MergeHeader("G6", "Vessel's" + Environment.NewLine + " Schedule", new List<string>() { "S", "SP" });

grdTab3Upper.MergeHeader("G7", "Weather", new List<string>() { "C", "CP" });

grdTab3Upper.MergeHeader("G8", "Shortage of" + Environment.NewLine + " Spare Part1", new List<string>() { "V", "VP" });

grdTab3Upper.MergeHeader("G9", "Non" + Environment.NewLine + " Installation", new List<string>() { "N", "NP" });

grdTab3Upper.MergeHeader("G10", "Unnecessary" + Environment.NewLine + " Item", new List<string>() { "U", "UP" });

grdTab3Upper.MergeHeader("G11", "Others", new List<string>() { "O", "OP" });

grdTab3Upper.MergeHeader("G12", Language.Tot_F, new List<string>() { "X", "XP" });

//내부 확장 메서드 


//이런 식으로 확장 

하나 하나 만들어서 그 안에 그룹을 넣어줌.

UltraGridGroup grpType = grdTab3Upper.DisplayLayout.Bands[0].Groups.Add();

grpType.Header.Appearance.FontData.Bold = DefaultableBoolean.True;

grpType.Header.Appearance.TextHAlign = HAlign.Center;

grpType.Header.Caption = "Type";

grpType.Key = "Type";

grdTab3Upper.DisplayLayout.Bands[0].Groups["G0"].RowLayoutGroupInfo.ParentGroup = grpType;


UltraGridGroup grpVessel = grdTab3Upper.DisplayLayout.Bands[0].Groups.Add();

grpVessel.Header.Appearance.FontData.Bold = DefaultableBoolean.True;

grpVessel.Header.Appearance.TextHAlign = HAlign.Center;

grpVessel.Header.Caption = "Vessel";

grpVessel.Key = "Vessel";

grdTab3Upper.DisplayLayout.Bands[0].Groups["G1"].RowLayoutGroupInfo.ParentGroup = grpVessel;


UltraGridGroup grpPriority = grdTab3Upper.DisplayLayout.Bands[0].Groups.Add();

grpPriority.Header.Appearance.FontData.Bold = DefaultableBoolean.True;

grpPriority.Header.Appearance.TextHAlign = HAlign.Center;

grpPriority.Header.Caption = "Priority";

grpPriority.Key = "Priority";

grdTab3Upper.DisplayLayout.Bands[0].Groups["G2"].RowLayoutGroupInfo.ParentGroup = grpPriority;


UltraGridGroup grpReason = grdTab3Upper.DisplayLayout.Bands[0].Groups.Add();

grpReason.Header.Appearance.FontData.Bold = DefaultableBoolean.True;

grpReason.Header.Appearance.TextHAlign = HAlign.Center;

grpReason.Header.Caption = "Reason";//Language.MaintenanceItem_F;

grpReason.Key = "Reason";

grdTab3Upper.DisplayLayout.Bands[0].Groups["G3"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G4"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G5"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G6"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G7"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G8"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G9"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G10"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G11"].RowLayoutGroupInfo.ParentGroup = grpReason;

grdTab3Upper.DisplayLayout.Bands[0].Groups["G12"].RowLayoutGroupInfo.ParentGroup = grpReason;



셀머지 하기 위해서는 다음의 2줄을 사용하면 됨.

grdTab3Upper.DisplayLayout.Bands[0].Columns["VesselTypeNM"].MergedCellEvaluationType = Infragistics.Win.UltraWinGrid.MergedCellEvaluationType.MergeSameText;


grdTab3Upper.DisplayLayout.Bands[0].Columns["VesselTypeNM"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;






반응형

'Winform' 카테고리의 다른 글

DevExpress 체크박스 Repository  (0) 2015.09.01
DevExpress 그리드 이벤트  (4) 2015.08.31
[DevExpress] 간트 차트  (0) 2015.08.31
[DevExpress] Spread Sheet 엑셀저장  (0) 2015.08.31
[DevExpress] Master Detail 그리드 설정  (0) 2015.08.31

댓글