How to set a field value = null in dataGrid?

  • Thread starter Thread starter J
  • Start date Start date
J

J

Situation - Using the table pubs.titleauthor in a strongly typed dataset,
attached to a datagrid, using the datagrid I would like to set the
royaltyper field = null (the database allows nulls in this field). But when
click on the cell and remove the field value (leaving a blank), and move to
the next record, the blank cell is filled with the original data.

When I view the schema (.xsd file) of the strongly typed dataset, and try to
change the null value or nillable property for the royaltyper field, the
strongly typed dataset that is in the designer disappears, the program will
not run (gets errors saying the dataset does not exist).

Questions are: In a datagrid, how does one null a field that allows nulls?
How does one change field properties in the .xsd file without having the
dataset disappear?
 
Hi,

The DataGridTextBoxColumn class has a NullText property. Set this property
to an empty string and the grid should treat blanks as nulls.
 
Back
Top