设置gridcontrol的焦点行

 private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DataRow dradd = gridView1.GetDataRow(gridView1.FocusedRowHandle);
                //params object[]
                DataRow dr = dtselected.NewRow();
                dr["TEMP_NAME"] = dradd["MR_NAME"].ToString();
                dr["TEMP_CODE"] = dradd["MR_CODE"].ToString();
                dr["FILE_PATH"] = dradd["ACCESS_PATH"].ToString();
                dr["FILE_NAME"] = dradd["TEMPLET_FILE_NAME"].ToString();
                dtselected.Rows.Add(dr.ItemArray);
                gridView2.FocusedRowHandle = dtselected.Rows.Count - 1;
                gc_selected.RefreshDataSource();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }

posted @ 2014-06-06 11:38  喜爱糖葫芦  阅读(4064)  评论(0编辑  收藏  举报