0

I have a DataGridView named "dgPins" in a Uer Interface. The columns are as shown below.

enter image description here

Now I'm looking to accomplish 2 tasks with this DataGridView.

  1. To limit the input size for the cells under column "PIN" to 4 digit numeric only.

I know for TextBox there's a property MaxLength where you can set the input length. Is there a simpler way to do it for DGVs too? And how to set the value type to numeric? I found a rollback solution here. But its not the most convenient answer for me.

  1. How to make an event handler to reject duplicate inputs for the same column cells? What even should I use to program this?
Isuru
  • 430
  • 5
  • 21
  • 2
    To limit input size - https://stackoverflow.com/questions/12903087/how-to-set-max-length-of-datagridview-column – saidfagan Sep 29 '17 at 07:35
  • And to disallow duplicate values look at this event https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvaluechanged(v=vs.110).aspx – saidfagan Sep 29 '17 at 07:37

0 Answers0