如何在按下回车键时从gridview窗口中获取行索引

时间:2013-12-08 09:57:15

标签: c# winforms datagridview

        grid_rowindex = dataGridView_city.Rows[e.RowIndex].Cells[0].Value.ToString();
        obj_Loc_Bank.product_id = grid_rowindex;
        obj_dt = obj_Loc_Bank.gridview_load_click();
        if (button_save.Visible == false)
        {
            textBox_prd_typ_code.Text = obj_dt.Rows[0]["Producr_Type"].ToString();
            textBox_manuf.Text = obj_dt.Rows[0]["Manufacture"].ToString();
            textBox_measure.Text = obj_dt.Rows[0]["Measurement"].ToString();
            textBox_packing.Text = obj_dt.Rows[0]["Packing_Type"].ToString();
            txt_prd_id.Text = obj_dt.Rows[0]["Product_Id"].ToString();

        }      

当按下回车键时应该发生这种情况..

0 个答案:

没有答案