.net - How to test a DataGridView cell/column for Date OR Nullable Date? -
we have code takes datagridview , stuff rows , columns.
for operations behaviour depends on column data type.
we can test system.string etc.
if grd.columns(x).valuetype gettype(system.string) ... endif or if prefer:
if (grd.columns(x).valuetype == typeof(system.string)) { } date columns can tested same way.
but if want test, basically, column date or nullable date how can that?
this answer helped. seems gettype (or typeof) happy datetime? datetime.
so can ask
if ... gettype(datetime) or ... gettype(datetime?) and off go.
p.s. or indeed gettype(nullable(of datetime))
Comments
Post a Comment