When developing an application in Visual Studio (C #), if I know that I will have a certain amount of DataGridViews, all have the same properties (such as width, height, color, some other properties, such as: disable the ability to directly edit rows, and etc.), is it good to make my own class ("myDataGridView"), which inherits the DataGridView class and performs all the settings there, and then just creates this class later in the code? Like this:
class myDataGridView : DataGridView
{
this.BorderStyle = <someValue>
this.ColumnCount = <someValue>
public void method1()
{
}
public void method2()
{
}
}
myDataGridView dgv1 = new myDataGridView();
myDataGridView dgv2 = new myDataGridView();
myDataGridView dgv3 = new myDataGridView();
Is this normal regarding OO principles? My friend says putting code as
this.BorderStyle = <someValue>
myDataGridView , dataGridView, Visual Studio, , . ? , DataGridView , , ? , DataGridView , , , , , myDataGridView. ? , , , DataGridView, /? .