Determining the Type for a datagrid column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid with several columns. When trying to validate the column
by looping through each column in the collection using a subscript I need to
first determine whether the column is defined as a string or an integer. Is
there a function that will allow me to do this? Note that the column types
and data remain the same. I just need to know whether the column is defined
as a string or integer to decide what validations to do.

Example:


Dim r As DataRow
Dim cols As DataColumnCollection
Dim c As DataColumn
cols = dstable1.Tables("Table1").Columns

For Each r In dstable1.Tables("Table1").Rows
For Each c In cols
If r(c, DataRowVersion.Current) ??? is string or integer
???
do something
next c
next r


thanks
 
Hi mh1mark

Would you by any chance be looking for the DataColumn.DataType property?
 
Back
Top