如何在c#中检查gridview中的重复数据

时间:2014-10-02 12:02:52

标签: c#

我有两个gridview,列和fieldname是相同的。 如何检查gridview中第一个到第二个gridview中是否有相同的数据?

这是我的代码。

<dx:ASPxGridView ID="gvwListCC" runat="server" Width="340px">
<Columns>
    <dx:GridViewDataTextColumn Caption="No" FieldName="Sequential" Width="10px"></dx:GridViewDataTextColumn>
    <dx:GridViewDataTextColumn Caption="IdDivisi" FieldName="RowId" Width="175px" Visible="false"></dx:GridViewDataTextColumn>
    <dx:GridViewDataTextColumn Caption="Divisi" FieldName="NamaDivisi" Width="300px"></dx:GridViewDataTextColumn>
    <dx:GridViewDataTextColumn ReadOnly="True" Caption="Action" Width="30">
        <DataItemTemplate>
            <asp:Button runat="server" ID="btnDeleteCC" OnClick="btnDeleteCC_Click" OnClientClick="return GetDeleteCC(this)" CssClass="lookupstyle" Text="Delete"
                idDivisi='<%# HttpUtility.UrlEncode(Eval("RowId").ToString()) %>'
                namaDivisi='<%# HttpUtility.UrlEncode(Eval("NamaDivisi").ToString()) %>'></asp:Button>
        </DataItemTemplate>
    </dx:GridViewDataTextColumn>
</Columns>
</dx:ASPxGridView>

<dx:ASPxGridView ID="gvwListTujuanInternal" runat="server" Width="340px">
<Columns>
    <dx:GridViewDataTextColumn Caption="No" FieldName="Sequential" Width="10px">    </dx:GridViewDataTextColumn>
    <dx:GridViewDataTextColumn Caption="IdDivisi" FieldName="RowId" Width="175px" Visible="false"></dx:GridViewDataTextColumn>
    <dx:GridViewDataTextColumn Caption="Divisi" FieldName="NamaDivisi" Width="300px"></dx:GridViewDataTextColumn>
    <dx:GridViewDataTextColumn ReadOnly="True" Caption="Action" Width="30">
        <DataItemTemplate>
            <asp:Button runat="server" ID="btnDeleteTujuanInternal" OnClick="btnDeleteTujuanInternal_Click" OnClientClick="return GetDeleteTujuanInternal(this)" CssClass="lookupstyle" Text="Delete"
                idDivisi='<%# HttpUtility.UrlEncode(Eval("RowId").ToString()) %>'
                namaDivisi='<%# HttpUtility.UrlEncode(Eval("NamaDivisi").ToString()) %>'></asp:Button>
        </DataItemTemplate>
    </dx:GridViewDataTextColumn>
</Columns>
</dx:ASPxGridView>

<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />

请问如何用我的问题在c#中创建逻辑?谢谢......

0 个答案:

没有答案