칸트 차트
사용 되는 class
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Drawing;
컨트롤
DevExpress.XtraScheduler.SchedulerControl
테이블 맵핑
1.Appointments(일정)
storage.Appointments.Mappings.AppointmentId = "AppointmentId"; //일정키
storage.Appointments.Mappings.Label = "Label"; //나타날 명칭
storage.Appointments.Mappings.Subject = "Subject"; //주제
storage.Appointments.Mappings.Description = "Description"; //설명
storage.Appointments.Mappings.ResourceId = "ResourceId"; //리소스 ID
storage.Appointments.Mappings.Start = "Start"; //시작일
storage.Appointments.Mappings.End = "End"; //종료일
storage.Appointments.Mappings.PercentComplete = "PercentComplete"; //진행상황
storage.Appointments.Mappings.Type = "Type";
//필요 없어 보이는 것들
//storage.Appointments.Mappings.Status = "Status";
//storage.Appointments.Mappings.AllDay = "AllDay";
//storage.Appointments.Mappings.Location = "Location";
//storage.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo";
//storage.Appointments.Mappings.ReminderInfo = "ReminderInfo";
2.AppointmentDependencies(일정간 상관관계 1대다 다대1)
storage.AppointmentDependencies.Mappings.ParentId = "AppointmentId"; //일정의 상위 키
storage.AppointmentDependencies.Mappings.DependentId = "AppointmentId"; //일정의 하위 키
storage.AppointmentDependencies.Mappings.Type = "Type";
3.Resources(좌측에 나올 문구)
storage.Resources.Mappings.Id = "ResourceId"; //리소스 키
storage.Resources.Mappings.ParentId = "ParentId"; //리소스 부모키
storage.Resources.Mappings.Caption = "CAPTION"; //문구
storage.Resources.Mappings.Color = "COLOR"; //색상
storage.Resources.Mappings.Image = "IMG"; //이미지
sc.OptionsCustomization.AllowAppointmentConflicts = DevExpress.XtraScheduler.AppointmentConflictsMode.Allowed;
//수정 삭제 막을 때
sc.OptionsCustomization.AllowAppointmentDelete = DevExpress.XtraScheduler.UsedAppointmentType.Recurring;
sc.OptionsCustomization.AllowAppointmentEdit = DevExpress.XtraScheduler.UsedAppointmentType.Recurring;
sc.OptionsCustomization.AllowInplaceEditor = DevExpress.XtraScheduler.UsedAppointmentType.Recurring;
//막대기 사이즈
sc.Views.GanttView.AppointmentDisplayOptions.AppointmentHeight = 25;
//퍼센티지및 진행률
//sc.Views.GanttView.AppointmentDisplayOptions.PercentCompleteDisplayType = PercentCompleteDisplayType.None;
//좌측메뉴
sc.GanttView.ShowResourceHeaders = true;
//sc.OptionsView.ResourceHeaders.Height = 40;
//DB연결
storage.Appointments.DataSource = _dsMaster.Tables[0];
storage.AppointmentDependencies.DataSource = _dsMaster.Tables[1];
storage.Resources.DataSource = _dsMaster.Tables[2];
//팝업 바꿔치기 기존 팝업 사용 안할 때
private void sc_EditAppointmentFormShowing(object sender, AppointmentFormEventArgs e)
{
Appointment ap = e.Appointment;
if (ap.Id != null)//Apointment 만 클릭했을 때 보이게, 나머지 빈공간 클릭시는 보이지 않게
{
PopTest pt = new PopTest(e.Appointment.Subject);
pt.ShowDialog();
}
e.Handled = true;
}
--------------------------------------------------------------------------------------
AppointmentId Label ResourceId Subject Description Start End PercentComplete
1 1 1 test1 2013-04-01 2013-04-08
2 2 2 test2 2013-04-13 2013-04-15
3 3 3 test3 2013-04-20 2013-04-28
4 4 4 test4 2013-04-20 2013-04-28
5 5 5 test5 2013-04-20 2013-04-28
6 6 6 test6 2013-05-25 2013-06-10
7 7 7 test7 2013-06-10 2013-06-15
8 8 8 2013-06-15 2013-07-30
ParentId DependentId
1 1 2
2 2 3
3 2 4
4 2 5
5 3 6
6 4 6
7 5 6
8 6 7
9 7 8
10 8 9
11 8 10
12 10 12
13 10 13
14 10 15
ResourceId SORT PARENT_ID CAPTION COLOR IMG
1 10 NULL test1 NULL NULL
2 20 NULL test2 NULL NULL
3 30 NULL test3 NULL NULL
4 40 NULL test4 NULL NULL
5 50 NULL test5 NULL NULL
6 60 NULL test6 NULL NULL
7 70 NULL test7 NULL NULL
8 80 NULL test8 NULL NULL
9 90 NULL test9 NULL NULL
10 100 NULL test9 NULL NULL
--------------------------------------------------------------------------------------
기타 정보
* 멤버
* https://documentation.devexpress.com/#WindowsForms/DevExpressXtraSchedulerSchedulerControlMembersTopicAll
*
//칸트로 뜨게 할때
this.sc.ActiveViewType = DevExpress.XtraScheduler.SchedulerViewType.Gantt;
수정, 삭제, 등 막을 때
this.sc.OptionsCustomization.AllowAppointmentConflicts = DevExpress.XtraScheduler.AppointmentConflictsMode.Forbidden;
this.sc.OptionsCustomization.AllowAppointmentDelete = DevExpress.XtraScheduler.UsedAppointmentType.Recurring;
this.sc.OptionsCustomization.AllowAppointmentEdit = DevExpress.XtraScheduler.UsedAppointmentType.Recurring;
this.sc.OptionsCustomization.AllowInplaceEditor = DevExpress.XtraScheduler.UsedAppointmentType.Recurring;
상단에 헤더 표시 부분 설정 가능
sc.Views.GanttView
display 옵션
sc.Views.GanttView.AppointmentDisplayOptions
//오른쪽 버튼 클릭시 실행 되는 놈.
https://documentation.devexpress.com/#WindowsForms/CustomDocument2280
'Winform' 카테고리의 다른 글
DevExpress 체크박스 Repository (0) | 2015.09.01 |
---|---|
DevExpress 그리드 이벤트 (4) | 2015.08.31 |
[DevExpress] Spread Sheet 엑셀저장 (0) | 2015.08.31 |
[DevExpress] Master Detail 그리드 설정 (0) | 2015.08.31 |
Infragistics Grid 멀티 헤더 (0) | 2015.08.26 |
댓글