Elyor
Elyor

Reputation: 5532

How to disable edit button for a row in listview

Here is my html code

<ItemTemplate>
        <td>
            <asp:Label ID="LabelID" runat="server" Text='<%# Eval("sysID")%>'></asp:Label>
        </td>
        <td>
            <asp:Label ID="Labelpar" runat="server" Text='<%# Eval("parameters")%>'></asp:Label>
        </td>
        <td>
            <asp:Label ID="LabelValue" runat="server" Text='<%# Eval("value")%>'></asp:Label>
        </td>
        <td>
            <asp:Button ID="btnEdit" runat="server" Text='Edit' CommandName="Edit" />
        </td>
</ItemTemplate>

I have 3 rows (a,b,c) in my column. How can I disable "Edit" button for row a?

by "disable" I mean user should not be able to click

Upvotes: 0

Views: 508

Answers (1)

A_Sk
A_Sk

Reputation: 4630

Not sure but definitely something like this

<asp:Button ID="btnEdit" runat="server" Text='Edit' Enabled='<%# (Eval("sysID")=="a")?False:True %>' CommandName="Edit" />

Upvotes: 1

Related Questions