I set the first the colum as a Combo Box column which is Databind.
My question is how can I know the value of Combox Box column or identify the cell as Combo Box in Cell Validating event of the Data Grid View.
All of the rows in the first column of this file need to be checked upon loading so that the length of its contents will be exactly 17 characters.
Here's what I've come up with: 0) /*This line is used to invoke the validation only for the first column (whose index is 0).
Do not hesitate to contact me again if you have other questions.
I don't know but I've put 2-3 times this same question but i still haven't got a full reply of how to get rid of this thing. I have one Data Grid View and I'm using it for taking input. Fund Code, Fund Description, Account No, Amount and Description. I want to display the first record by default when the row is added to this Combo Box or atleast find a way to control if there is no value in Combo Box column for any row.
I handle the validation in the Cell Validating event, and if the cell is invalid display an error message, then cancel the exit of edit mode.
However I would also like to erase the content of the cell currently in edit mode.
Ken's code for e.formatted value does work but only in case of first and single row.
If i have more then one row and the user click on any other column in newly generated row it won't work as the validating event doesn't fire. Hey , I understand that help never comes when most required, but were you able to find a solution to this I have a similar problem in which I have two combobox columns in my datagridview.
Previously i was having a problem when the user click on the Combo Box but doesn't click the mouse so the Combo Box change commited event doesn't run therefore not getting the row, somebody replied on this forum to say i should declare and put a Combo Box On Drop Down event handler which i put and successfully do it.