如何在没有选择的情况下在数据网格中显示数据? [英] How do I show data in datagrid without selection?

查看:66
本文介绍了如何在没有选择的情况下在数据网格中显示数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#windows窗体应用程序中创建了一个DataGrid。数据网格中的数据加载正常。但它仅在选择行或单元格时可见。我没有更改任何默认值。



它没有给出任何错误。



那么如何在没有选择的情况下让数据网格显示数据呢?



我是什么尝试过:



我检查了DefaultCellStyle属性,Back颜色和forecolor是不同的。

Hi, I have created a DataGrid in C# windows form application. Data in datgrid loading ok. But its only visible when rows or cell are selected. I did not change anything from default.

Its not giving any errors.

So How can I get the datagrid to show data without selection?

What I have tried:

I checked the DefaultCellStyle Property, Back color and forecolor are different.

推荐答案

我改变了Rowstyle属性的背景颜色和前景色,并且它有效。
I changed the backcolor and forecolor of Rowstyle property and it worked.


这篇关于如何在没有选择的情况下在数据网格中显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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