Is it possible to switch rows and columns in a datagridview?

前端 未结 5 749
夕颜
夕颜 2020-12-03 22:35

I have 10 records of data in a DataTable which has 3 fields \"Foo\", \"Bar\", and \"Baz\".

If I connect wire this into a DataGridView I see 10 rows and 3 columns, an

5条回答
  •  孤城傲影
    2020-12-03 22:56

    Apply a LayoutTransform to the DataGrid:

    
        
            
            
            
        
        
            
                
                
            
        
    

    You also need to reverse the column headers:

    
        
    
    

    and the cells, otherwise they come out mirrored and rotated:

        
            
        
    
    
    

提交回复
热议问题