private void GrdDivTbl_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { DataGridViewRow data = GrdBooksTbl.Rows[e.RowIndex]; //TODO : 클릭 시 입력컨트롤에 데이터 할당 TxtIdx.Text = data.Cells[0].Value.ToString(); TxtAuthor.Text = data.Cells[1].Value.ToString(); //장르 콤보박스 //로맨스, 추리 등 디스플레이되는 글자로 인덱스찾기 //CboDivision.SelectedIndex = CboDivision.FindString(data.Cells[3].Value.ToString()); //코드값을 그대로 할당하는 방법 b001,b002 CboDivision.SelectedValue = data.Cells[2].Value; TxtNames.Text = data.Cells[4].Value.ToString(); //TODO : 출간일 날짜픽커Cells[5] DtRealeasDate.CustomFormat = "yyyy-MM-dd"; DtRealeasDate.Format = DateTimePickerFormat.Custom; DtRealeasDate.Value = DateTime.Parse(data.Cells[5].Value.ToString()); TxtIsbn.Text = data.Cells[6].Value.ToString(); TxtPrice.Text = data.Cells[7].Value.ToString(); TxtIdx.ReadOnly = true; //pk값 수정 못하게 막기 TxtAuthor.Focus(); myMode = BaseMode.UPDATE; //수정모드 변경 } }
private void TxtDivision_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { TxtAuthor.Focus(); } }
private void ClearTextControls() { TxtIdx.Text = TxtAuthor.Text = TxtNames.Text = TxtISBN.Text = ""; CboDivision.SelectedIndex = -1; TxtIdx.ReadOnly = true; //txtIdx는 자동 증가 TxtIdx.BackColor = Color.Beige; TxtAuthor.Focus(); }
private void BtnNew_Click(object sender, EventArgs e) { InitControls(); myMode = BtnMode.INSERT; // 신규입력 모드 TxtAuthor.Focus(); }
private void ClearTextControls() { TxtPrice.Text = TxtISBN.Text = TxtNames.Text = TxtIdx.Text = TxtAuthor.Text = ""; TxtIdx.ReadOnly = true; CboDivision.SelectedIndex = -1; TxtIdx.BackColor = Color.Beige; TxtAuthor.Focus(); DtpReleaseDate.CustomFormat = " "; DtpReleaseDate.Format = DateTimePickerFormat.Custom; }
/// <summary> /// 입력창 초기화 /// </summary> private void ClearTextControls() { TxtIdx.Text = ""; TxtAuthor.Text = ""; TxtNames.Text = ""; TxtISBN.Text = ""; TxtPrice.Text = ""; CboDivision.SelectedIndex = -1; // 아무것도 선택안함 DtpReleaseDate.CustomFormat = " "; // 공백이 한칸 들어가야함 DtpReleaseDate.Format = DateTimePickerFormat.Custom; TxtAuthor.Focus(); }
private void ClearTextControls() { TxtIdx.Text = TxtAuthor.Text = TxtISBN.Text = TxtNames.Text = DtpReleaseDate.Text = ""; TxtPrice.Text = ""; CboNames.SelectedIndex = -1; //이거 필수 레벨 설정하는거랑 관련해서 -1부터 시작!!!1 TxtIdx.ReadOnly = true; TxtIdx.BackColor = Color.Beige; DtpReleaseDate.CustomFormat = " "; DtpReleaseDate.Format = DateTimePickerFormat.Custom; // 값을 리셋해주는 방법 TxtAuthor.Focus(); }