C#datagridview文本样式? [英] C# datagridview text style ?

查看:153
本文介绍了C#datagridview文本样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

-------
No|Data
-------
1 |123
-------
2 | 1 2 3
-------





它是在C#Winform上显示的DataGridView。



第一张唱片是通过HeidiSQL添加的。

第二个是通过DataGridView在C#Winform上的新行添加的。



我只想要第一个记录样式。

谁能告诉我是什么让第二种风格以及如何修复它?



提前致谢。



我尝试了什么:



我发现了一些东西,但还没有解决。





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.在第二行添加按键'abc'的新行。它看起来如下。



1. Add new row with keystroke 'abc' at second line. It looks like below.

-------
No|Data
-------
1 |123
-------
2 |abc
-------





2.留下行

3.使用相同的数据编辑。



2. Leave row
3. Edit with same data.

-------
No|Data
-------
1 |123
-------
2 |abc
-------





4.其他单元格也很好。



4. And it goes well on other cell.

-------
No|Data
-------
1 |123
-------
2 |abc
-------
3 |def
-------





只有文本键才能生成此选项。数字键没有。

'1 2 3' - > '4 5 6'



这不是空白。



这让我很疯狂。



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

It's not a blank.

This makes me crazy.

推荐答案

查看实际数据 - 它可能包含如果没有,那么你需要查看原始DataGridView行的创建方式,以及是否对它们应用了任何特殊样式,因为新行将继承默认行/列样式,而不是每行应用的任何自定义样式。
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.


这篇关于C#datagridview文本样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆