Hi,
I found that I need to overwrite the paint method. This is how I did
this:
class DataGridViewLinkLabelCell : DataGridViewCell
{
private LinkLabel ll = new LinkLabel();
public DataGridViewLinkLabelCell() : base()
{
ll.LinkBehavior = LinkBehavior.NeverUnderline;
ll.Padding = new Padding(2);
ll.AutoSize = true;
}
protected override void Paint(Graphics graphics,
Rectangle clipBounds, 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);
//ll.Size = cellBounds.Size;
ll.Location = cellBounds.Location;
this.DataGridView.Controls.Add((LinkLabel)this.Value);
}
...
}
But I still don't have exactly what I want (the LinkLabel is added
topleft on the userform). I'll keep looking and when I progress, I'll
update this thread (who knows someone might struggle with the same
issue;-).
Fre