简体   繁体   中英

How to add checkbox control at the Header of DatagridviewCheckBoxColumn?

Can anyone please provide the C# coding to add checkbox control at the Header of DatagridviewCheckBoxColumn.

Convert the Check Box Column to a template field. Then add the Check box to the header template.

I think WarithNath is right. Here is a suggestion code.

<asp:TemplateField>
   <EditItemTemplate>
        <asp:CheckBox ID="CheckBox1" runat="server" />
   </EditItemTemplate>
   <ItemTemplate>
        <asp:CheckBox ID="CheckBox1" runat="server" />
   </ItemTemplate>
   <HeaderTemplate>
       <asp:CheckBox ID="CheckBoxToSelectAll" runat="server" />
   </HeaderTemplate>

</asp:TemplateField>

Hope it works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM