简体   繁体   English

在网格视图的顶部插入数据

[英]Insert data at the top of grid view

I am trying to insert records to a database from asp.net grid view. 我试图将记录从asp.net网格视图插入数据库。 Inserted records are displaying as a last record in the grid view. 插入的记录在网格视图中显示为最后一条记录。 But I want to display the record at the top row of the grid view ie, very next row of header. 但是我想将记录显示在网格视图的第一行,即标题的下一行。

Can anyone help me? 谁能帮我? I have googled a lot but couldn't find best solution. 我已经在Google上搜索了很多,但是找不到最佳的解决方案。

插入后绑定网格时,首先对结果表进行排序,以将可以将新插入的行放在顶部的某些列值排序,如果它是自动递增字段或某些日期列等,则可以是id列。然后使用您的结果表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM