我想使用 .net 组件 DataGridView 为行标题和列标题提供来自图像的自定义背景。甚至可以这样做吗?如果是这样,怎么做到的?
我使用 Visual Studio 2008、Windows 应用程序、C#。
最佳答案
可以更改数据 GridView 行标题的属性。您需要处理 CellPainting 或 RowPostPaint 事件并在行标题单元格中手动绘制图像。
protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)
{
// Your code to insert image/content per cell goes here
}
关于c# - 在 C# 中为 dataGridView 单元格提供背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1722013/