how to get check box in data gidview control using c#.net

Posted by Gayathrirachu under C# on 2/8/2011 | Points: 10 | Views : 2660 | Status : [Member] | Replies : 4
iam having a table

where it contains 5 columns
now i want to display these columns in to a data gridview along with check boxes
can any one tell me how to display gridview with check boxes

using c#.net




Responses

Posted by: Sutotpal on: 2/8/2011 [Member] Starter | Points: 25

Up
0
Down
hi Gayathrirachu,

I have an example, find it in Attachment or u can check out this link

http://www.dotnetspark.com/kb/151-add-checkbox-inside-datagridview-windows.aspx
 Download source file

Best Regards,
Sutotpal

Gayathrirachu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/8/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
The above example is pretty good.

Making use of Template Column you can achieve the same.

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Gayathrirachu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down

Posted by: Tripati.patro on: 2/18/2011 [Member] Starter | Points: 25

Up
0
Down
DataGridView in windows application directly provide column of type CheckBox.

1) Place a datagridview on your form.
2) Go to properties-> Edit Columns -> Add a new column
3) Select the column Type as DatagridViewCheckBoxColumn.
4) If the column is bounded to any datasource then provide the DataPropertyName for this column.
5) After providing DataPropertyName the next important thing is to fill FalseValue and TrueValue properties.
For example 0/N for FalseValue and 1/Y for TrueValue as per your stored database value.

Hope these steps will help you.

B.Tripati Patro
Oracle Certified Associate

Gayathrirachu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response