954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Checkbox problem in gridview

Hi,
I am using the 'DataGridViewCheckBoxColumn' class to show the checkbox in each row of gridview. The checkboxes require 0 & 1 values to show the checkboxes checked and unchecked. The select query which builds the datasource for Gridview shows the 0 & 1 values being fetched from database.
Now my problem is- the checkboxes always remain unchecked irrespective of values assigned 0 or 1. I checked gridview properites but didnt get the solution. Can anyone guide me?

vinayphadke
Newbie Poster
9 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

Paste the code here.

sufyan2011
Junior Poster
166 posts since Dec 2011
Reputation Points: 9
Solved Threads: 20
 

Hi,

I wanted put the code here... but as Network was down.. I couldn't post anything... But after scratching head for 8 hrs , it got resolved.

The resolution was: The DataPropertyName Property of DatagridviewChekbox column was not getting set properly. the actual column to which the checkboxes are going to be bound, was "Column1" and the DataPropertyName was getting set to "Column1 ". (the space was getting added). So just applied trim function and the problem got resolved...

Thanks. :)

vinayphadke
Newbie Poster
9 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You