2016-10-05 7 views
-2
private void dgw_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 
{ 
    try 
    { 
     DataGridViewRow dr = dgw.SelectedRows[0]; 
     TextBox1.Text = dr.Cells[0].Value.ToString(); 
     cmdproduct.Text = dr.Cells[1].Value.ToString(); 
     txtqty.Text = dr.Cells[2].Value.ToString(); 
     txtrate.Text = dr.Cells[3].Value.ToString(); 
     //txtstockdate.Text = dr.Cells[4].Value.ToString(); 
     // txtstockdate.Value = Convert.ToDateTime(dr.Cells[4].Value.ToString()); 
    } 
    catch (Exception ex) 
    { 
     MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 
    } 
} 
+1

でのDataGridView日のショーを置く – Foitn

答えて

0
DateTime stockDate; 
if (DateTime.TryParse(dr.Cells[4].Value.ToString(), out stockDate)) 
{ 
    dateTimePicker1.Value = stockDate; 
} 
関連する問題