Link to home
Start Free TrialLog in
Avatar of Jimbo99999
Jimbo99999Flag 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
ASKER CERTIFIED SOLUTION
Avatar of BuggyCoder
BuggyCoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nasir Razzaq
So datagridview will only contain one row?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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.