我有一個gridview gvData我想要的是當TransType列中的記錄等於甜品,然後顯示寫,RT。如果其他東西只顯示關閉編輯刪除。在GridView中啓用/禁用鏈接按鈕根據條件
關閉編輯刪除寫RT是一個模板字段
ID TRANSTYPE R C TIME
1 Dessert 12:00 12:05 12 Close Edit Delete Write RT
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lbClose" runat="server" CausesValidation="False" CommandName="CloseClicked" OnClick="CloseClick_Click">Close</asp:LinkButton>
<asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" CommandName="EditRow" OnClick="Edit_Click" CommandArgument='<%# Eval("Id")%>'>Edit</asp:LinkButton>
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="DeleteRow"OnClick="Delete_Click" OnClientClick="return confirm('Are you sure you want to Delete this Transaction?');">Delete ||</asp:LinkButton>
<asp:LinkButton ID="lbWrite" runat="server" CausesValidation="False" CommandName="WriteClicked" OnClick="Write_Click">Write</asp:LinkButton>
<asp:LinkButton ID="lbRT" runat="server" CausesValidation="False" CommandName="RT"OnClick="RT_Click">RT</asp:LinkButton>
</ItemTemplate>
我編輯了你的答案,我找到了Trans by lblTrans。請+1我的問題 – Apollo