0

我有一个主网格,其中一列是editbutton。当我单击此网格内的编辑按钮时,打开另一个表单。双击此表单后,它关闭,我将值移动到我的主网格。但到目前为止,它可以传输数据但未显示在主网格内。**我还启用了“添加新行事件”,我将值移动到其中。(我还检查了字段名,gridview 属性的名称是否正确但不起作用)

//edit button doubleclcik event here 

private void btnStokSec_Click(object sender, EventArgs e)
{
   string Id = OpenAnaotherForm();
   if (!string.IsNullOrEmpty(Id))
   {
      int _Id = Convert.ToInt32(Id);
      Stoklar stoklar = bll_stk.GetirById(_stokId)[0];
      string f4 = stoklar.Birim.ToString();
      this.gridView1.AddNewRow();
      MessageBox.Show(f7.ToString()); //I am able to get data correctly here
      this.gridView1.SetFocusedRowCellValue(Birim, f4);// but not here
      ............
      ...........
   }
}
4

1 回答 1

0

你能提供更多代码吗?两种形式的代码?你说 f7 变量有数据,但我看不出它是在哪里设置的。

您还可以考虑将公共方法添加到弹出表单可以调用并传递值的基础表单。

于 2014-03-28T20:31:26.230 回答