Hello,
I`m having problem with ShowDialog() when I make some changes. I`ll try to explain whole situation provided with adequate code.
So I`m having form for some calculation, lets call it CalcForm. On that form I have button which redirect me to another form DetailsForm(datagridview with some information). Here is the code:
frmNovartisALL frm = new frmNovartisALL();
frm.ShowDialog();
this.product = frm.product;
if (product == null)
{
return;
}
else
{
txt_price.Text = this.product.Price1.ToString();
txt_price1.Text = this.product.Price2.ToString();
txt_price2.Text = this.product.Price3.ToString();
}
When I click on linkbutton "Change" in gridview, whit this code
int id = (int)gv_novartis.CurrentRow.Cells["ID"].Value;
product = Products.SearchByID(id);
this.Close();
all information about selected row are populated in first form.
And everything works well. When I change some information in CalcForm and save them, and when I again open DetailsForm all changed information are there also. But, here is the problem- if I click again on linkbutton in gridview- in CalcForm are shown information before editing. Only way to make it work is to restart application.
I now its bit confusing, but if you have any ideas- plese let me now.
Just to say also- everything is updated well in database.