By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,649 Members | 1,572 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,649 IT Pros & Developers. It's quick & easy.

How to set a field value = null in dataGrid?

P: n/a
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?
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

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

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"J" <se******@sendspam.com> wrote in message
news:vo************@corp.supernews.com...
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?


Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.