Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi
I want to make a column in controler of DataGridView, and the column is made up with a checkbox and a label, that means some words follow with a checkbox in DataGridView. Does any one has done that, and any idea will be welcome, and please say specifically.


--additional question:this is kind of winform project,and I know something about custom column in datagridview。 However, there is no suitable class can be inherited in order to perform preview shape, which is a checkbox followed by some words.
--thank you
Posted
Updated 26-Feb-12 20:58pm
v2
Comments
Dean Oliver 27-Feb-12 0:47am    
is this for win forms or wpf?
dirk.zhang 27-Feb-12 3:28am    
winform
dirk.zhang 1-Mar-12 3:53am    
still waiting for the proper answer

 
Share this answer
 
Comments
dirk.zhang 27-Feb-12 1:16am    
thank you for answering me, However, now I do a winform project.
And I know I should do a custom column, But I don't know which column should I inherit, the DataGridViewTextBoxCell or DataGridViewChechBoxCell
Dean Oliver 27-Feb-12 3:06am    
use DataGridViewCheckBoxCell
dirk.zhang 27-Feb-12 3:20am    
OK,and using the DataGridViewCheckBoxCell, How can I add label at the end of checkbox
 
Share this answer
 
Hi you can make use of text and text align property here.

XML
<asp:CheckBox ID="chkPreferred" runat="server" Checked='<%#Eval("Preferred")%>' Enabled="false" Text="Label" TextAlign ="Left">
</asp:CheckBox>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900