How to set a field value = null in dataGrid?

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?
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top