grid에 데이터 넣기
private void SetChkStatusGrid()
{
string[] ChkStatusName = new string[]{"Seq.1) BarCode Scanner Check...",
"Seq.2) MES SERVER Connection Check...",
"Seq.3) MES_NET file Execute Check...",
"Seq.4) LOT ID FILE Search...",
"Seq.5) LOT ID FILE Downloading..."};
string strName = "";
int HeaderCnt = 2, ColumnCnt = 6;
gridChkStatus.BorderStyle = BorderStyle.FixedSingle;
gridChkStatus.BackColor = Color.Black;
gridChkStatus.Redim(ColumnCnt, HeaderCnt);
for (int row = 0; row < ColumnCnt; row++)
{
for (int col = 0; col < HeaderCnt; col++)
{
if (row == 0)
{
if(col == 0) strName = "CHECK PROCESS.....";
else strName = "PASS/FAIL";
gridChkStatus[row, col] = new SourceGrid2.Cells.Real.ColumnHeader(strName);
m_ChkStsHeaderColor.TextAlignment = ContentAlignment.MiddleCenter;
gridChkStatus[row, col].VisualModel = m_ChkStsHeaderColor;
}
else
{
if (col != 0){
gridChkStatus[row, col] = new SourceGrid2.Cells.Real.Cell();
}
else {
gridChkStatus[row, col] = new SourceGrid2.Cells.Real.Cell(ChkStatusName[row - 1]);
}
gridChkStatus[row, col].VisualModel = m_ChkStsBackColor;
}
}// for int col
} // for int row
// gridChkStatus[1, 1] = new SourceGrid2.Clls.Real.Cell("only test");
gridChkStatus.AutoSizeAll();
}
색 및 정렬하기
private SourceGrid2.VisualModels.Common m_ChkStsPColor;
private SourceGrid2.VisualModels.Common m_ChkStsFColor;
private SourceGrid2.VisualModels.Common m_ChkStsBackColor;
private SourceGrid2.VisualModels.Common m_ChkStsHeaderColor;
public LotIDScanForm(RegistryStruct MainRegStruct)
{
..................
m_ChkStsPColor = new SourceGrid2.VisualModels.Common();
m_ChkStsFColor = new SourceGrid2.VisualModels.Common();
m_ChkStsBackColor = new SourceGrid2.VisualModels.Common();
m_ChkStsHeaderColor = new SourceGrid2.VisualModels.Common();
// Chk Status를 위한 Color 생성.
m_ChkStsPColor.BackColor = Color.Green;
m_ChkStsFColor.BackColor = Color.OrangeRed;
m_ChkStsBackColor.BackColor = Color.AliceBlue;
m_ChkStsHeaderColor.BackColor = Color.Khaki;
// 문자열 정렬.
m_ChkStsPColor.TextAlignment = ContentAlignment.MiddleCenter;
m_ChkStsFColor.TextAlignment = ContentAlignment.MiddleCenter;
m_ChkStsBackColor.TextAlignment = ContentAlignment.MiddleCenter;
m_ChkStsHeaderColor.TextAlignment = ContentAlignment.MiddleCenter;
'프로그래밍 > .Net' 카테고리의 다른 글
Control Location 사용법 알아보자 (0) | 2014.01.17 |
---|---|
FileInfo 사용하여 File 속성 가져와 Delete Day 설정하기 (0) | 2014.01.17 |
Tab Control index change (0) | 2014.01.17 |
textbox 글자넣기 (0) | 2014.01.17 |
KeyPress 어떠한 Key가 눌러졌는지 알고싶다면.... (0) | 2014.01.17 |