Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a gridview that dynamically binded from database.
first column of gridview is a checkbox.
I want that just this column be editable and can check and uncheck it.
How can I do it?
Posted

1 solution

Hi,

Take a look into the below code

XML
<asp:GridView ID="gvmails" runat="server" AutoGenerateColumns="false">
           <Columns>
               <asp:TemplateField HeaderText="Select">
                   <ItemTemplate>
                       <asp:CheckBox ID="chkSelect" runat="server" />
                   </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField HeaderText="Column 1">
                   <ItemTemplate>
                       <asp:Label ID="lblColumn1" runat="server" Text='<%# Eval("Column1") %>'></asp:Label>
                   </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField HeaderText="Column 2">
                   <ItemTemplate>
                       <asp:Label ID="lblColumn2" runat="server" Text='<%# Eval("Column2") %>'></asp:Label>
                   </ItemTemplate>
               </asp:TemplateField>
           </Columns>
       </asp:GridView>



Regards,
Manoj
 
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