2009-11-24 11 views

답변

2

은의 당신이 IDTextBoxColumn라는 ID 열이 있다고 가정 해 봅시다. 다음과 같이 각 행에 대한 값을 얻을 수 있습니다.

1
Domain.Master.Product product = new Domain.Master.Product(); 
      foreach (DataGridViewRow dr in dataGridView1.Rows) 
      { 
       if (dr.Cells[0].Value == null) 
       { } 
       else 
       { 
        ProductViewModel pvm =roduct.ProductDetails(dr.Cells[0].Value.ToString()); 
        dr.Cells[3].Value = pvm.PCode.ToString(); 
        dr.Cells[4].Value = pvm.Pdtcatagory; 
       } 
      } 
관련 문제