Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9265391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:03:40+00:00 2026-06-18T14:03:40+00:00

I am not able to add Checkbox in column header to multi-select(select all) Rows

  • 0

I am not able to add Checkbox in column header to multi-select(select all) Rows of Datagridview, I google it but they are giving me to add checkbox in row not in column header.

So that I’ll select all check box column header click.
Please look at the image belowfor example. it is the listview image that i got form internet But I’m using Datagridview.
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:03:41+00:00Added an answer on June 18, 2026 at 2:03 pm

    I got this from internet but I can’t remember where is the link and originally comes from c#.

    Private checkboxHeader231 As CheckBox
    Private Sub show_chkBox()
        Dim rect As Rectangle = DataGridView1.GetCellDisplayRectangle(columnIndexOfCheckBox, -1, True)
        ' set checkbox header to center of header cell. +1 pixel to position 
        rect.Y = 3
        rect.X = rect.Location.X + 8 + (rect.Width / 4)
        checkboxHeader231 = New CheckBox()
        With checkboxHeader231
            .BackColor = Color.Transparent
        End With
    
        checkboxHeader231.Name = "checkboxHeader1"
        checkboxHeader231.Size = New Size(18, 18)
        checkboxHeader231.Location = rect.Location
        AddHandler checkboxHeader231.CheckedChanged, AddressOf checkboxHeader231_CheckedChanged
        DataGridView1.Controls.Add(checkboxHeader231)
    End Sub
    
    Private Sub checkboxHeader231_CheckedChanged(sender As System.Object, e As System.EventArgs)
        Dim headerBox As CheckBox = DirectCast(DataGridView1.Controls.Find("checkboxHeader1", True)(0), CheckBox)
        For Each row As DataGridViewRow In DataGridView1.Rows
            row.Cells(columnIndexOfCheckBox).Value = headerBox.Checked
        Next
    End Sub
    

    Usage:

       Sub Form1Load(sender As Object, e As EventArgs) Handles MyBase.Load
            show_chkBox()
       End Sub
    

    I hope it will helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading images externally using jQuery load function.. but not able add light
Not able to store all binary data values into sqlite3 table using QT. For
not able to get this, can someone help for this LINQ query? select col1,
plz tell me whats wrong in code bcz i m not able to add
This may be somewhat of a simple question but if i add a column
Am not able to add events to a id. Though able to attach event
Hi i am not able to add uiactivity indicator in uitableview controller, can someone
I have toughly searched and not able to find how to check what datagridview
Not able to download artifacts from central maven repository. <mirrors> <!-- mirror | Specifies
Im not able to load the page with circlepageindicator. This is the xml <FrameLayout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.