[英]FocusedRowHandle not setting correctly in a DevExpress GridView C#
[英]Set cell value in devexpress focusedrowhandle from combo box that is not in the gridview
我想在按下按鈕時在TECNICO列中設置組合框文本。
但是在運行時,我無法在TECNICO列中顯示設置值
private void asing_Click(object sender, EventArgs e)
{
if ( tecnicos.Text.Length > 0)
{
try
{
SqlConnection con = conec.ObtenerCon();
SqlCommand sel = new SqlCommand("SELECT * FROM RTID_STATUS WHERE ID_RTID='" + gridView1.GetFocusedRowCellValue(colID_RTID) + "'", con);
SqlDataReader rs = sel.ExecuteReader();
if (rs.Read())
{
con.Close();
SqlConnection con1 = conec.ObtenerCon();
MessageBox.Show(" hay :\t" + gridView1.GetFocusedRowCellValue(colID_RTID));
SqlCommand up = new SqlCommand("UPDATE RTID_STATUS SET ID_TECH='" + idtec(tecnicos.Text) + "'", con1);
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, tec,tecnicos.Text.ToString());
gridView1.RefreshRow(gridView1.FocusedRowHandle);
SqlDataReader resu = up.ExecuteReader();
con1.Close();
}
else
該值是否存在於RepositoryItemComboBoxEdit的Items集合中?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.