Click here to Skip to main content
14,699,570 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have Gridview in which some field like id,qty,price,image,isenabled,isdeleted
i want to use isenabled for checkbox button..
in item template it would be read only mode..
in edit template,i want to change checkbox with checked or unchecked...
plz post code...
Updated 18-Sep-12 0:18am

1 solution

Can't you have an edit item template? In EditItemTemplate & ItemTemplate of GridView take a CheckBox. In EditItemTemplate, let the checkbox to be enabled. And in item template just disable it.
Try this:
    <asp:checkbox id="chk" runat="server" enabled="false" checked='<%#Eval("CheckedInd")%>'/>
    <asp:checkbox id="chkEdit" runat="server" enabled="true" checked='<%#Eval("CheckedInd")%>'/>

All the best.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900