Home All Groups Group Topic Archive Search About

User Data Validation in a Datagrid.

Author
16 Jun 2006 9:55 AM
marcmc
I have a datagrid linked to one table using dataAdaptor via the following code:

Try
  SqlDataAdapter1.Fill(DataSet11)
  dgThreshold.DataSource = DataSet11.DefaultViewManager
Catch ex As Exception
  MessageBox.Show("Could not connect to Dataset/Database")
End Try

Field index 4 can only have a Y or N enetered by users.
How can I ensure this?

I have been messing with the properties within the following to no avail.

DataSet11.MISRE_Threshold.Columns(4).

Note: the 'Unique' preoperty suggests that the namespace allows iteration
through a columns data, surely the .Text property is not too far away.

Author
16 Jun 2006 2:36 PM
tomb
marcmc wrote:

Show quoteHide quote
>I have a datagrid linked to one table using dataAdaptor via the following code:
>
>Try
>  SqlDataAdapter1.Fill(DataSet11)
>  dgThreshold.DataSource = DataSet11.DefaultViewManager
>Catch ex As Exception
>  MessageBox.Show("Could not connect to Dataset/Database")
>End Try
>
>Field index 4 can only have a Y or N enetered by users.
>How can I ensure this?
>
>I have been messing with the properties within the following to no avail.
>
>DataSet11.MISRE_Threshold.Columns(4).
>
>Note: the 'Unique' preoperty suggests that the namespace allows iteration
>through a columns data, surely the .Text property is not too far away.

>
You could use the ColumnChanged event on the datatable, berify it is the
column that is restricted, and test for the valid values.

T