hi, i have a problem with my code. i have 1 tab control and 3 tabs. now the problem is that when i switch from one tab to another i want the datagridviews to clear their selection. this code works but when one selects the tab for the second time. any help pls?
private void tabControl1_Selected(object sender, TabControlEventArgs e)
{
if (tabControl1.SelectedTab == tbStarter)
{
dgvLightMeal.ClearSelection();
}
if (tabControl1.SelectedTab == tbMainCourse)
{
dgvPasta.ClearSelection();
dgvPizza.ClearSelection();
dgvGrill.ClearSelection();
dgvKids.ClearSelection();
}
}