列值更改后如何在ASP GridView中插入空白行

时间:2018-07-12 21:29:49

标签: c# asp.net aspxgridview

我有一个asp gridview,只要第一列(Col1)中的值更改,我都想输入空白行。下面的示例。

Col1

A
A

B
B

C
C
C

下面是我的asp gridview:

<asp:GridView ID="GridView1" AutoGenerateColumns="false" DataSourceID="SqlDataSource1"
        runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No entries.">
        <Columns>
                <asp:BoundField HeaderText="Test1" DataField="Col1" />
                <asp:BoundField HeaderText="Test2" DataField="Col2"  />
                <asp:BoundField HeaderText="Test3" DataField="Col3" />
        </Columns>
    </asp:GridView>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyDB %>"
SelectCommand=
"SELECT * FROM Table ORDER BY Col1">   
</asp:SqlDataSource> 

0 个答案:

没有答案