GridView - Show headers on empty data source

后端 未结 16 1256
挽巷
挽巷 2020-11-28 11:22

In C# how do I still show the headers of a gridview, even with the data source is empty.

I am not auto generating the columns as they are all predefined.

C

16条回答
  •  失恋的感觉
    2020-11-28 12:09

    You can use HeaderTemplate property to setup the head programatically or use ListView instead if you are using .NET 3.5.

    Personally, I prefer ListView over GridView and DetailsView if possible, it gives you more control over your html.

提交回复
热议问题