WinForms윈폼 FpSpread의 CellClick 이벤트에서 checkbox 적용 관련 문의
페이지 정보
작성자 모오오라 작성일 2023-10-05 15:06 조회 238회 댓글 0건본문
관련링크
안녕하세요.
CellClick 이벤트를 이용하여
checkbox를 클릭 할 경우 check 유무에 따라
데이터를 가져와 다른 FpSpread의 Sheet의 checkbox에 check를 하는 코드를 짜는 중
문제가 있어서 문의 드립니다.
1. 디버깅을 걸면 CellClick 에는 들어 오나 UI 상에 check가 토글이 안됩니다.
2. UI상 토글도 되지 않고 "True" 상태가 들어오지 않습니다.
아래 코드에서 FpSpread_Sheet1.Cells[e.Row, 0].Text 에
처음 클릭하면 ""(string.Empty)가 들어오고 UI는 아무런 반응이 없습니다.
그 상태에서 다시 한번 클릭하면 "False"가 들어 옵니다.
아무래도 제가 CheckBox CellType 컨트롤에 대해서 잘못 이해를 하고 있거나
CellClick 이벤트 발생 시점을 제대로 이해 못한거 같은데 해당 부분 확인 부탁드립니다.
private void FpSpread_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
{
if (FpSpread.Sheets[0].RowCount == 0)
return;
if (e.ColumnHeader && e.Column == 0)
{
}
else if (e.Column == 0)
{
if (FpSpread_Sheet1.Cells[e.Row, 0].Text == "True")
{
if (this.materialID != FpSpread_Sheet1.Cells[e.Row, (int)COL.MAT_ID].Text)
{
this.materialID = FpSpread_Sheet1.Cells[e.Row, (int)COL.MAT_ID].Text;
DataTable dt = 데이터 파싱;
if (dt != null)
{
FpSpread_right_Sheet1.Cells[0, 0].Text = dt.Rows[0]["MAT_AP01"].ToString() == "Y" ? "True" : "False";
FpSpread_right_Sheet1.Cells[1, 0].Text = dt.Rows[0]["MAT_AP02"].ToString() == "Y" ? "True" : "False";
FpSpread_right_Sheet1.Cells[2, 0].Text = dt.Rows[0]["MAT_AP03"].ToString() == "Y" ? "True" : "False";
FpSpread_right_Sheet1.Cells[3, 0].Text = dt.Rows[0]["MAT_AP04"].ToString() == "Y" ? "True" : "False";
}
}
}
}
}
댓글목록
등록된 댓글이 없습니다.