Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change DataGridViewColumn behavior
Message
 
À
13/04/2011 12:49:26
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01507121
Message ID:
01507155
Vues:
39
>>>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform