1
기본적으로 C에서 청구서를 만드는 중입니다. 셀에서 다음 값을 선택한 다음 셀프 컴팩을 만들 필요가 있습니다. 선택한 값에 해당하는 데이터로 자동 완성되어야합니다. . 자동 완성 된 datagridview 텍스트 상자 셀에 데이터 가져 오기
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 1)
{
SqlDataReader dreader;
AutoCompleteStringCollection acBusIDSorce = new AutoCompleteStringCollection();
cmd =new SqlCommand("Select * from SUP_PRO",conn);
conn.Open();
dreader = cmd.ExecuteReader();
if (dreader.HasRows == true)
{
while (dreader.Read())
acBusIDSorce.Add(dreader["P_name"].ToString());
}
else
{
MessageBox.Show("Data not Found");
}
dreader.Close();
TextBox Product = e.Control as TextBox;
if (Product != null)
{
Product.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
Product.AutoCompleteCustomSource = acBusIDSorce;
Product.AutoCompleteSource = AutoCompleteSource.CustomSource;
}
하지만이 코드는 MRP 등의 다른 세포의 데이터뿐만 아니라 같은 배치를 가져올 도와주세요 .. P_name 내 데이터 테이블의 한 컬럼에서 데이터를 가져 오는되지
PLZ 도와주세요 감사합니다