Hi,

I have a custom combobox (say ComboExt). I need to host this control in datagridview. In MSDN (http://msdn.microsoft.com/en-us/library/7tas5c80.aspx), they are saying, to host custom controls, my own column types with cells should be created. That is, I need to create a custom ComboExtColumn derived from DataGridViewColumn and all properties in DataGridViewComboBoxColumn like DataSource,Items, AutoComplete etc should be implemetend. I feel it is very complicated.

My question is, Could I use DataGridViewComboBoxColumn instead of DataGridViewColumn to host my custom combobox(ComboExt) in DataGridView like as below?

public class ComboExtColumn : DataGridViewComboBoxColumn
{   
    //Code        
}
public class ComboExtCell : DataGridViewComboBoxCell
{
   //Code 
}
class ComboExtEditingControl : ComboExt, IDataGridViewEditingControl
{
}

Please provide some idea. Sorry for my bad English.

Recommended Answers

All 2 Replies

Your English is as good as mine. :)
I don't see why you could not do what you are trying to do.
You only got to have some indebt knowledge of all the objects involved. In the beginning this can look very complex, I know. The more you are using and manipulating DataGridView, the less hazier it will become.
A good way to start is to download and read this document
Succes!

Thank you very much. I will look into it.
Mean time I started working on it. Will update soon

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.