如何在datagridview的行头显示图片 在datagridview的行头,就是最左边的固定列,如何在行头单元格里显示图片呢?希望高手分享你们的解决方案 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 固定列难道不是普通的列马?ItemTemplate -> <img src=""> 楼上的,看仔细了,是datagridview,而不是web form里的datagrid,在datagrid里没有固定列行头概念。 曾经试过这样重写事件,没有效果,还望高手指正 Image delimage = 获取图片...... protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e) { base.OnCellPainting(e); HitTestInfo info = HitTest(e.CellBounds.Left, e.CellBounds.Top); if (e.RowIndex >= 0 && info.Type == DataGridViewHitTestType.RowHeader) { e.Graphics.DrawImageUnscaled(delimage, e.CellBounds.Left, e.CellBounds.Top); } } 关于 强命名程序集 请问如何开发一个QQ聊天机器人? c# 里的GIF图片不会动,请问应该怎样处理? c#怎么控制该程序只能启动一次? datalist问题 TreeView web控件 显示的树型线条为什么不对齐??? 救命呀!!!C#.NET c#调用excel C#能对Excel文件操作吗? 关于图片绑定及显示的问题 Visual Studio 2013 中的新增功能有没有新的语法? GridView c# 如何RSA加密, 和javascript 相互验证。
固定列难道不是普通的列马?ItemTemplate -> <img src="">
Image delimage = 获取图片......
protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
{
base.OnCellPainting(e); HitTestInfo info = HitTest(e.CellBounds.Left, e.CellBounds.Top);
if (e.RowIndex >= 0 && info.Type == DataGridViewHitTestType.RowHeader)
{
e.Graphics.DrawImageUnscaled(delimage, e.CellBounds.Left, e.CellBounds.Top); }
}