Add row to grid view

前端 未结 5 1995
予麋鹿
予麋鹿 2021-02-14 07:57

Is it possible to programmatically add a row to a GridView in C# ASP?

If yes, how ?

I want to add static data directly from the code, not from an array nor an da

5条回答
  •  悲&欢浪女
    2021-02-14 08:50

    GridViewRowsCollection doesn't have .Add method, so you can't do it directly to the GridView.

    There're alternatives. For example if you bind it to a DataTable - you can add custom row with data to the DataTable.

    Another alternative - do it on client by adding a row to rendered HTML Table.

提交回复
热议问题