Create a user control class DataGridViewEx and paste the code snippet given. You can use this control where you want an inherited DataGridView.

Download source code & sample:


using System;
using System.ComponentModel;
using System.Design;
using System.Drawing;
using System.Windows.Forms;

namespace DataGridViewInheritance
{

    [Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
    public partial class DataGridViewEx : DataGridView
    {
        public DataGridViewEx()
        {
            InitializeComponent();
        }
    }
}