【发布时间】:2012-10-29 16:57:01
【问题描述】:
我想为datagridviewcell 托管一个自定义控件。
我唯一的好参考是http://msdn.microsoft.com/en-us/library/7tas5c80.aspx
但是,我希望单元格在
上显示我自己的用户控件 public class CustomCell : DataGridViewTextBoxCell
{
protected override void Paint(System.Drawing.Graphics graphics,
System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds,
int rowIndex, DataGridViewElementStates cellState, object value, object
formattedValue, string errorText, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
{
base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value,
formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts);
}
}
谁能指导我怎么做?
【问题讨论】:
标签: c# winforms datagridview custom-controls