Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change DataGridViewColumn behavior
Message
De
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:
01507154
Vues:
49
This message has been marked as the solution to the initial question of the thread.
>>>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 ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform