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

  • Home
  • SEARCH
  • 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 6654879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:26:39+00:00 2026-05-26T01:26:39+00:00

Using VB.Net (Windows Application) I am using checkbox in the girdview column, now i

  • 0

Using VB.Net (Windows Application)

I am using checkbox in the girdview column, now i want to add a checkbox in the header.

If i select the checkbox in the header, all the checkbox in the column should select automatically.

How to do this.

Need VB.Net Code Help

  • 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-05-26T01:26:39+00:00Added an answer on May 26, 2026 at 1:26 am
    Protected Sub chkbSelectAll_CheckedChanged(sender As Object, e As EventArgs)
        Dim chkFlag As Boolean = False
        If chkbSelectAll.Checked Then
            chkFlag = True
        End If
        For Each dr As GridViewRow In gvProducts.Rows
            Dim chk As CheckBox = DirectCast(dr.Cells(0).FindControl("Select"), CheckBox)
            chk.Checked = chkFlag
        Next
    End Sub
    

    I’m not sure this code is well-written. I just convert from this C# code (which is working);

    protected void chkbSelectAll_CheckedChanged(object sender, EventArgs e)
        {
            bool chkFlag = false;
            if (chkbSelectAll.Checked) chkFlag = true;
            foreach (GridViewRow dr in gvProducts.Rows)
            {
                CheckBox chk = (CheckBox)dr.Cells[0].FindControl("Select");
                chk.Checked = chkFlag;
            }
        }
    

    Algorithm is simple. Define a boolean value for checking checkboxes are selected or not. If checked assign it true. for all gridview rows, find controls with columns name then set them all.

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

Sidebar

Related Questions

Im using c# .net windows form application. I have loaded names of all the
I try to add an addons system to my Windows.Net application using Reflection; but
How to create a windows registry watcher application using .Net, I want this application
I am used to Windows application development using C# .Net. Now that I got
We developing an Application using .NET Framework 4.0 (C#) windows forms based application. Now,
Using VB.Net, C#.Net and SQL Server. Windows Application I want to separate a code
I wrote a windows application using C# .Net 2.0 and i want to do
Im using c# .net windows application form. I have created many databases with many
Using VB.NET Windows Based Application In my software I am using a login page,
Im using c# .net windows form application. i have a SQL database with 5

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.