DataGridVeiw이벤트에 EditingControlShowing추가

e.Control.KeyPress이벤트 연결


KeyPress와 연결한 함수에서


if (((DataGridViewTextBoxEditingControl)sender).Text.Length >= 제한할 길이 수 

  && ((DataGridViewTextBoxEditingControl)sender).SelectedText.Length <= 0)

      e.Handled = true;


SelectedTextLength는 블록 지정했을때 수정이 가능하게끔 하기 위함



블로그 이미지

SherryBirkin

,