We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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?

2
Contributors
2
Replies
2 Days
Discussion Span
1 Year Ago
Last Updated
3
Views
Question
Answered
vinayphadke
Newbie Poster
11 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Paste the code here.

sufyan2011
Junior Poster
166 posts since Dec 2011
Reputation Points: 9
Solved Threads: 22
Skill Endorsements: 0

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
11 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by sufyan2011

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0623 seconds using 2.74MB