Since you have not added your new row yet it should validate OK." yeah i think it is because of the line you have said above how can i avoid this situation???thanxxxxxxxxxxx If you have attached an event handler to the Cell Validating event then it will always fire when focus leaves the cell.* You may obtain a copy of the License at * * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. MAP_ABSTRACT_TYPE_CLASS_TO_ABSTRACT_TYPE; import static com. Since you have not added your new row yet it should validate OK.Or if not, then it is because the user has entered an invalid value in the current cell. Something there is causing the cell validating event to fire. [Edit] The validating event is firing because focus is being moved from the DGV to the button. Value Is Nothing Then ' Show the user a message Message Box.
Something there is causing the cell validating event to fire. [Edit] The validating event is firing because focus is being moved from the DGV to the button.
How can I disable the cell validating event for the rows that was added before???
thankxxxxxx There are two ways to manage unwanted execution of event handlers.
Hi there, I have a question regarding datagridview, I add data to the datagridview in an interface and all the validation for the datagridview cell is in the datagridview cell validating event for the datagridview.
I display the data of the is datagridview in another interface and make the cells read-only. But the thing is when I click on a row that data was added previously and press the Add new row the cell validating event is triggered.1) Add a conditional statement in the event handler code to only execute when required.2) Detach the event hander before the unwanted event triggers and re-attach after.Or if not, then it is because the user has entered an invalid value in the current cell.