Show “No record found” message on a WPF DataGrid when it's empty

后端 未结 4 1683
陌清茗
陌清茗 2020-12-18 22:13

If there is no record available, I want to add a TextBlock on data grid, below the header, showing the message \"No Record Found.\"

Consider the attac

4条回答
  •  我在风中等你
    2020-12-18 22:47

    Its been a long time since the question has been posted. But I thought this might be useful to someone else.

    
       
    
    
    
    
    
    

    For simplicity purpose I have set AutoGenerateColumns="True". Please define the columns. This way when a empty datasource is bound, the column names will be shown along with 'Empty row' message.

提交回复
热议问题