首页 > 代码库 > 设置gridcontrol的焦点行
设置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());
}
}