Can anyone please provide the C# coding to add checkbox control at the Header of DatagridviewCh开发者_Go百科eckBoxColumn.
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!
精彩评论