Yes, but as far as I know you need to do it all yourself. So if you plan on
reusing this sometime you can always just derive from the DataGrid and wire
in the logic yourself. You may need to make a few modifications to the code
below, but this should get you started.
public class MyDataGrid : System.Windows.Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScrollBar.Visible = true;
this.VertScrollBar.VisibleChanged += new
EventHandler(VertScrollBar_VisibleChanged);
}
private void VertScrollBar_VisibleChanged(object sender, EventArgs e)
{
this.VertScrollBar.Visible = true;
}
protected override void OnResize(System.EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScrollBar.Bounds = new Rectangle(this.ClientRectangle.Width -
this.VertScrollBar.Width, 0, this.VertScrollBar.Width,
this.ClientRectangle.Height);
base.OnResize(e);
}
}