Windows Forms Datagrid Problem

Hi,

I have a datagrid tied to a dataview.  I want to validate the information that is being entered.  I want to accept only numbers in a column or only letter in another one.

I'll really appreciate your help on this matter.

Thanks,

Roberto Acevedo
.Net Programmer
Guatemala City, Guatemala


Answer this question

Windows Forms Datagrid Problem

  • Ken Maier

    The Whidbey DataGridView control has validation capabilities.

    Use the DataGridView::CellValidating event to validate data at the cell level: for example to check that the cell value falls between certain limits.

    Or you can use the DataGridView::RowValidating event to validate data on the entire row: for example to check that the sum of the values in several cells in the same row is within certain limits.

    Hope this helps,
    Daniel.

  • Chazoo

    Try to state what version of the framework you are working with when asking quesitons. I assume since the other post didn't help that you might be using 1.1.

    Here is a sample project I did for the 1.1 datagrid.

    http://www.planet-source-code.com/vb/scripts/ShowCode.asp txtCodeId=1591&lngWId=10

    Hope this helps

    Jose

  • Windows Forms Datagrid Problem