Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have done my invitee management project for about 8 0 % but stuck with the edit part. I want the program to do the

I have done my invitee management project for about 80% but stuck with the edit part. I want the program to do the following :
- When we click view, only datagridview1 appears.
- When we want to modify the data, go to datagridview2, inside the datagridview2 can add, update or delete. After modification, click edit. The data will automatically refreshes in the datagridview1.
I will attach my coding here, please help me:
private void btn_Edit_Click(object sender, EventArgs e)
{
// Handle multiple delete in DataGridView2
// Update the shared DataTable with changes from DataGridView2
dataGridView2.EndEdit(); // Commit any pending edits
adapter.Update(dataSet.Tables["Invitees"]); // Update the database with changes
RefreshDataGridView(); // Refresh DataGridView1 to reflect the changes
}
}
private void btn_Clear_Click(object sender, EventArgs e)
{
// Clear all textboxes and reset DataGridView visibility
textBox_Name.Text ="";
textBox_TableNo.Text ="";
textBox_searchInv.Text ="";
textBox_searchTableNo.Text ="";
dataGridView2.DataSource = null;
dataGridView1.Visible = true;
RefreshDataGridView();
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

Types of Interpersonal Relationships?

Answered: 1 week ago

Question

Self-Disclosure and Interpersonal Relationships?

Answered: 1 week ago