Link to home
Create AccountLog in
Avatar of allanmark
allanmark

asked on

DataGridView interaction with LinkLabel and Button

Greetings all,

I have a very starnge one ...

If you're in a grid edit, with  the cell empty and have validation to ensure that the field contains data, then trying to click on a button, outside of the grid, will cause the validation warning to pop up. However, if you click on a linklabel it allows this....

Is this normal? Is there a way I can change it so that the attempt to click on the linklabel will also cause the avlidation to kick in?


In advance, thanks!!!
     allanmark
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

I don't understand the interaction.  Where is the Button and LinkLabel defined?
Avatar of allanmark
allanmark

ASKER

Sorry ...

The LinlLable and Button are both outside of the grid.
What type of column are you working with in the DataGridView?
Its a text column.

Can you attach a .png screen shot of what you mean?
Please c attached.

In the grid you will see that the bottom row (which was a n insert is indicating an error. Yet, we are able to click on the Delete linklable.
LinkLabelButton.png
Ok, I see what you mean now.  Why don't you disable the "Delete" LinkLabel when you are on the last row (which you know is the row where you add new records)?
Could do that.

Similiar logic would apply to the Insert - disable when the user inserts and enable when they move off.

However, if the user edits a record and the edits is in error (deleted the text), I could then still click the Insert) which results in the unusual situation of a record in error (flagged) and an blank record, awaiting input.

ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Many thanks!!