如何在没有选择的情况下在数据网格中显示数据?
问题描述:
我在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.