Add row to grid view

前端 未结 5 2330
庸人自扰
庸人自扰 2021-02-14 08:28

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:41

    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.

提交回复
热议问题