I use in the same Form a textbox and an auxiliary datagrid where the name and size of attachments are writen as my code shows it. This datagridview is important because I want to select attachments and not all of them. When I click, it adds at Detail Datagrid as second column the Line Number ( it belongs to composite primary key ) and on the 4 column the path of the attachment.
The problem I have is: when the Detail DataGridview is filled ( after clicking the attachments I want ) I make the Save on the Navigator and only Master record is saved ( no detail record is saved ) . After some "googling" I understand that this can be linked with BeginEdit in Detail Table but ( as a beginner ) I cannot solve this issue even after reading a lot of commnts.
Any help is appreciated ( adding the missing code to my code ).
//auxiliary Grid. ++l; textBox1.Text = dataGridView1.CurrentCell.Value.ToString(); System.Diagnostics.Process.Start("mspaint.exe", textBox1.Text); DataRow dr = dtg1.NewRow(); dr[0] = codTextBox.Text; dr[1] = l; dr[3] = textBox1.Text; dtg1.Rows.Add(dr); //detMailGridView.BeginEdit() - ??????????? //fill detail grid detMailDataGridView.DataSource = dtg1; //( after this instruction I click Save } |
Replies
Know the answer? Post it — somebody with the same question will find it here.