2009-06-24 2 views
0

사람 메신저간트 차트

PilotDataContext pilot = new PilotDataContext(); 

var schedule = from x in pilot.slot_tbl_Schedules select x; 

foreach (var s in schedule) 
{ 
    if (s.AppointmentType == "Repair") 
    { 
     CellLayout cl = gn.GetCell(0).Layout.Clone() as CellLayout; 
     gn.GetCell(0).Layout = cll; 
     cl.BackgroundColor = Color.Red; 
     cl.SelectedColor = Color.Red; 
    } 
    else if (s.AppointmentType == "Service") 
    { 
     CellLayout cl = gn.GetCell(0).Layout.Clone() as CellLayout; 
     gn.GetCell(0).Layout = cl; 
     cl.BackgroundColor = Color.Blue; 
    } 
    else if (s.AppointmentType == "TravelTime") 
    { 
     CellLayout cl = gn.GetCell(0).Layout.Clone() as CellLayout; 
     gn.GetCell(0).Layout = cl; 
     cl.BackgroundColor = Color.Green; 
    } 
    else if (s.AppointmentType == "AnnualLeave") 
    { 
     CellLayout cl = gn.GetCell(0).Layout.Clone() as CellLayout; 
     gn.GetCell(0).Layout = cl; 
     cl.BackgroundColor = Color.Yellow; 
    } 
} 

의 구문 경우를 다음과 같이 LINQ 쿼리에서 점점 메신저 VAR에 따라 개별 셀 색상을 시도으로 asp.net 3.5 plexityhide의 GTP.NET을 사용하고있다 문은 사람이

답변

1

당신이 CellLayout.BackgroundUse = true를 설정 확인이

많은 감사에 도움이 될 수 있습니다 추천 한 것입니다. 당신이하지 않으면 배경색이 무시됩니다.

그리고 당신은 당신이 CellLayouts에 컬렉션에 새 복제 CellLayouts을 추가해야하며,이 CSS를 생성합니다 ASP.NET에게 cellLayouts를 사용하기 때문에 :

Gantt_ASP.Gantt.Grid.CellLayouts.Add (CL);

0
Dim cl2 As CellLayout = TryCast(e.GridNode.GetCell(4).Layout.Clone(), CellLayout) 

cl2.SelectedColor = Color.Red 
cl2.FontColor = Color.Red 
cl2.BackgroundColor = Color.Blue 
cl2.BackgroundUse = True ' when is true background color change 
e.GridNode.GetCell(4).Layout = cl2 

그것은 ..... 잘 일하고있어 :)

관련 문제