设置DataGridView样式

设置DataGridView样式
private   void  setKessantoukeiDataGridView()
        {
            
this .dgvEvent.Columns.Clear();

            DataGridViewTextBoxColumn colList 
=   new  DataGridViewTextBoxColumn();
            colList.Name             
=   " " ;
            colList.HeaderText       
=   " " ;
            colList.DataPropertyName 
=   " " ;
            colList.DefaultCellStyle.Alignment 
=  DataGridViewContentAlignment.MiddleCenter;
            colList.ReadOnly         
=   true ;
            colList.Width            
=   200 ;
            DataGridViewTextBoxColumn colRow 
=   new  DataGridViewTextBoxColumn();
            colRow.Name              
=   " " ;
            colRow.HeaderText        
=   " " ;
            colRow.DataPropertyName  
=   " " ;
            colRow.DefaultCellStyle.Alignment 
=  DataGridViewContentAlignment.MiddleCenter;
            colRow.ReadOnly          
=   true ;
            colRow.Width             
=   200 ;
            DataGridViewTextBoxColumn colCol 
=   new  DataGridViewTextBoxColumn();
            colCol.Name              
=   " " ;
            colCol.HeaderText        
=   " " ;
            colCol.DataPropertyName  
=   " " ;
            colCol.DefaultCellStyle.Alignment 
=  DataGridViewContentAlignment.MiddleCenter;
            colCol.ReadOnly          
=   true ;
            colCol.Width             
=   200 ;

            
this .dgvEvent.Columns.Add(colList);
            
this .dgvEvent.Columns.Add(colRow);
            
this .dgvEvent.Columns.Add(colCol);
            
            
this .dgvEvent.RowHeadersVisible  =   false // RowHeaderを非表示
        }







你可能感兴趣的:(设置DataGridView样式)