Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have one gridview control,

This control i have bind checkbox and this checkbox have bind property to bind data this come from database.

I need to disable those all checkboxs those are already checked.

and I want give facitlity to change checkbox only those not true value in database.

In short I need to disable checkbox those are checked.



Thanks in advance
Posted
Updated 20-Dec-11 21:14pm
v2

XML
<asp:GridView ID="grdTemp" runat="server" AllowPaging="True"
           AutoGenerateColumns="False" DataKeyNames="TIME" Height="40px"
           PageSize="8" ShowFooter="True"  >
           <PagerSettings Mode="NumericFirstLast" />
           <RowStyle BackColor="WhiteSmoke" BorderColor="CornflowerBlue" ForeColor="Black"
               Height="30px" />
           <Columns>
               <asp:TemplateField >
                   <ItemTemplate>
                       <asp:CheckBox ID="chkSelect" runat="server" />
                   </ItemTemplate>
               </asp:TemplateField>
               <asp:BoundField DataField="TIME" HeaderText="TIME" /><<pre>FooterStyle BackColor="Silver" Height="25px" />
            <PagerStyle BackColor="DarkGray" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        </asp:GridView>



OnCheckedChanged event write the following code

if chk.checked=true then
      chk.enabled=false
 
Share this answer
 

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