Creating a simple Table in WPF?

后端 未结 2 1105
无人及你
无人及你 2021-02-05 14:03

I was wondering if there is a way (any components/controls) that allow me to draw a simple Microsoft Word style table in my application window. Something like this:

2条回答
  •  清酒与你
    2021-02-05 14:14

    It depends on how you want to use it. Either use one of the ItemsControl (like DataGrid, ListView etc), do it directly with a Grid panel (as recommended by the other answers) or use a FlowDocument

    FlowDocument allows you to specify Tables, Rows and Columns. You can also select several cells at once for Copy/Paste etc.

    enter image description here

    
        
            
        
        
            
                    
                    
                    
                    
                
                    
                        
                            Category
                        
                        
                            A
                        
                        
                            B
                        
                        
                            C
                        
                    
                    
                        
                            Subscription
                        
                        
                            Monthly
                        
                        
                            Yearly
                        
                        
                            Monthly
                        
                    
                    
                        
                            Price
                        
                        
                            $120.00
                        
                        
                            $1000.00
                        
                        
                            $130.00
                        
                    
                

    This page is full of usefull examples about this: FlowDocument with Table

提交回复
热议问题