Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change DataGridViewColumn behavior
Message
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01507121
Message ID:
01507155
Views:
38
>>>>I don't want to have NULL values when I empty the value of the column.
>>>>I want when the user empty the value to have an empty string in it :-)
>>>>How to do this?
>>>>
>>>>Thanks in advance.
>>>
>>>You could try:
dataGridView.Columns[x].DefaultCellStyle.NullValue = String.Empty;
>>>But I dunno if it will work :-{
>>
>>Thank you Viv,
>>but no, it didn't work :o(
>>I could handle this in CellFormating, but I thought there is a better solution :-)
>
>I did a quick test after posting (just by dragging a dataset with a nullable field onto the form and setting the relevant property as above) and it did indeed seem to work for me. How are you binding and what happened when you tried it? What happens if you use:
dataGridView.Columns[x].DefaultCellStyle.NullValue = "Unknown";
and use Ctrl-0 on the cell ?


When I set it to everything bu String.Empty it works, but if it is String.Empty I'm in trouble :-)
Thank you Viv.
I should decide what to use.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform