Click here to Skip to main content
15,910,234 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
-------
No|Data
-------
1 |123
-------
2 | 1 2 3
-------


It's DataGridView displaying on C# Winform.

First record was added via HeidiSQL.
Second was added via DataGridView's new row on C# Winform.

I just want the first record style.
Can anyone tell me what makes second style and how I can fix it?

Thanks in advance.

What I have tried:

I found something but it's not solved yet.

-------
No|Data
-------
1 |123
-------
  |
-------


1. Add new row with keystroke 'abc' at second line. It looks like below.
-------
No|Data
-------
1 |123
-------
2 |abc
-------


2. Leave row
3. Edit with same data.
-------
No|Data
-------
1 |123
-------
2 |abc
-------


4. And it goes well on other cell.
-------
No|Data
-------
1 |123
-------
2 |abc
-------
3 |def
-------


Only text key makes this. Number key doesn't.
' 1 2 3 ' -> ' 4 5 6 '

It's not a blank.

This makes me crazy.
Posted
Updated 27-Aug-18 14:51pm
v5
Comments
Richard MacCutchan 27-Aug-18 9:17am    
We cannot guess what your code is doing. Please provide some proper details.

1 solution

Look at the actual data - it's likely that it contains the spacing.
If it doesn't, then you need to look at how the original DataGridView rows are created, and if any special styling was applied to them as the new row will inherit the default row / column style, not any custom style that has been applied on a "per row" basis.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900