Avatar of Jimbo99999
Jimbo99999
Flag for United States of America asked on

VB.net - DataGridView CheckBox Columns

Good Afternoon Experts!

I have a task that I am not quite sure how to accomplish in the code.  I have a DataGridView that I am loading from a SQL database query.  The records returned will have the first 3 values as regular columns in the DataGridView.  The 4th value in the record I need to add a column to the DataGridView as a checkbox and make the heading of the column the actual value.  Then each subsequent record that is in the resulting records of the SQL query I don't need to load a new line in the DataGridView, I just need to make a new checkbox column for the 4th value with the actual value as the column header.  

So, I will have 1 row in the DataGridView with the first 3 values being standard columns. Then columns 4 on need to be dynamically added in code based on number of results returned form the SQL query.  

Username       First      Last       Can Edit     Can Update   Can Add
BobH                Bob       H             (chk)          (chk)              (chk)

Any ideas where I can start?

Thansk,
jimbo99999
Visual Basic.NET

Avatar of undefined
Last Comment
Jimbo99999

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
BuggyCoder

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Nasir Razzaq

So datagridview will only contain one row?
SOLUTION
asfahani

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jimbo99999

ASKER
The requirements have changed for this part of the project which will be a design change for this functionality.  I will have to make a new question if I cannot find a solution.

I still wanted to award points for the responses since I added them to my knowledge base for future consideration/reference.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23