TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
web
NA
6
0
adding multiple controls in DataGridViewColumn
Dec 13 2006 2:42 PM
Hi All, Ive trying to create a custom datagridview where one customized column could contain checkBox, textBox, or even listboxes. I know I would have to override the dataGridViewCell class, but how to I add a control to the cell i.e. If i want to create a customized DataGridviewCell where the cells contain checkboxes? My code below show display checkboxes, but it doesnt.... Any help would be appreciated, Thanks Here's the paint method in my class: public class DataGridViewCustoomizedCell : DataGridViewCell{ protected override void Paint( Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) { // Call the base class method to paint the default cell appearance. CheckBox chk = new CheckBox(); chk.Text = "hehe"; base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, chk, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); } }
Reply
Answers (
1
)
crystal report database change at runtime
Object Factories with Lazy Loading in C#