I have a modal where I use the same for inclusion and change of the data.
I checked that the txtid
field is populated. If you have is change, not inclusion.
To fill in the fields the user needs to select the row of the grid, where the id is retrieved to make the change.
But I need to clear the modal if the user does not make the change.
I created a button that updates the grid, loses the selection and clears the txt, but it opens with the fields all filled in.
GridAgenda();
GridView1.SelectedIndex = -1;
txtid.Text = "";
GridAgenda()
is the method that loads the GridView.
Sometimes it selects and does not change, I click on this button to clear, and I click on the register, the modal is filled with the last line selected.