I am wondering if there is an easy way to embed a custom combo in the WinGrid. My customer combo is something like:
public partial class ComboEditor : UserControl
{
}
The reason that it is inheriting from UserControl is to add a button in the conrol as well. But before the butto I have added the UltraComboEditor.
Yes, one of the features added to NA 2009.2 was the Infragistics.Win.UltraWinEditors.UltraControlContainerEditor control, which gives you an easy way to use your own custom control as an embeddable editor. You place your custom control on it, and assign it to the column's EditorComponent property.
Thanks for the help. I tried and it helped, but when I unfocus from the cell, the text is not shown in that cell. But when I focus to the cell again, the text of the combo is shown. I tried to set its rendering properties using a text box, but the cell is shown with the border of the text box, when I use the label the program crashes!
koolmike90 said:It has a Text properties as well. I am wondering what properties does the Grid call to get the text of the combo? Is it ToString() or Text or ...?
This is handled but the UltraControlContainerEditor. I think by default, it uses the Text property of the EditingControl. But you can pick another property using the EditingControlProperty property.
Yes, it is weired to me as well because it is working with VS combo!
But our combo box is made up of two parts. We have created the combo like this:
public class TwoColumnFlatComboBox : System.Windows.Forms.UserControl
//some general texts
Then we are inheriting this
//this inherits from the above code
public class BaseTwoColDataComboBox : TwoColumnFlatComboBox {
Then we inherite our special columns, which we add on the form:
public class twoColItemsComboBox : BaseTwoColDataComboBox {
//Now whe we use that combo,twoColItemsComboBox, we cannot see the text of the combo when we unfocus from the cell.
It has a Text properties as well. I am wondering what properties does the Grid call to get the text of the combo? Is it ToString() or Text or ...?
koolmike90 said:I tried and it helped, but when I unfocus from the cell, the text is not shown in that cell.
There could be any number of reasons for this. Perhaps the DataType of the property you are using on the combo doesn't match the data type of the grid column and so it can't update the cell. Without more information about exactly what you are doing and how you are doing it, it's really impossible to guess.
koolmike90 said:I tried to set its rendering properties using a text box, but the cell is shown with the border of the text box, when I use the label the program crashes!
I'm not sure what this means.