I have created a user control (custom DataGridView control). I have used the example in this MSDN article to set the border style.
I am able to see the selected border style in designer. Like None, FixedSingle or Fixed3D.
But when I set the border style to FixedSingle, the border does not appear at runtime. Do I need to draw it manually in the OnPaint method?
If I use following code
private BorderStyle borderStyle = BorderStyle.None;
[Browsable (true)]
public new BorderStyle BorderStyle
{
get
{
return borderStyle;
}
set
{
if (borderStyle != value)
{
if (!Enum.IsDefined(typeof(BorderStyle), value))
{
throw new InvalidEnumArgumentException("value", (int)value, typeof(BorderStyle));
}
base.BorderStyle = value;
UpdateStyles();
}
}
}
The border on designer but its size is fixed, its smaller than the grid size. Its size remain same even if I resize grid and the same border appears in runtime.