从不在gridview中的组合框中设置devexpress focusedrowhandle中的单元格值

时间:2013-11-03 00:06:14

标签: c# devexpress

我想在按下按钮时在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

1 个答案:

答案 0 :(得分:0)

RepositoryItemComboBoxEdit的Items集合中是否存在该值?