Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridTextBoxColumn AllowDBnull Not Found

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
VB.net 1.1 data grid. Column is a DataGridTextBoxColumn with Nulltext = "" and bound to a decimal column of a table in SQL 2000 which allows nulls. I also set the width, alignment, format, etc. The column correctly displays any null values as blank. However it seems I cannot change the value to a DBNull.Value once it's in the grid. I can change the data table column to null before it is bound to the grid, but not after. The error I get when I try and change it through code is "Cast from type 'DBNull' to type 'Decimal' is not valid". There doesn't appear to be "AllowDBnullValue" in the DataGridTextBoxColumn. This must be possible. Am I missing something obvious here? Do I have to use another column type?

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top