Type | Description | |||
Object | An ActiveX object being used as an user editor. |
The following VB sample adds an ActiveX editor, ( Exontrol's ExComboBox ):
With XMLGrid1.Editors With .Add("excombobox", UserEditorType) .UserEditor "Exontrol.ComboBox", "" With .UserEditorObject .BeginUpdate .LabelHeight = XMLGrid1.NodeHeight - 3 .LinesAtRoot = True .HeightList = 256 .WidthList = 256 .IntegralHeight = True .Columns.Add ("Name") .Columns.Add ("Value") .ColumnAutoResize = True With .Items Dim h As Long, h1 As Long h = .AddItem("Item 1") .CellCaption(h, 1) = "Item 1.2" h1 = .InsertItem(h, , "SubItem 1") .CellCaption(h1, 1) = "SubItem 1.2" h1 = .InsertItem(h, , "SubItem 2") .CellCaption(h1, 1) = "SubItem 2.2" .ExpandItem(h) = True End With .EndUpdate End With End With End With
The following C++ sample adds an ActiveX editor, ( Exontrol's ExComboBox ):
#include "Editor.h" #include "Editors.h" COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR; CEditors editors = m_xmlgrid.GetEditors(); CEditor editor = editors.Add( COleVariant( "excombobox" ), 16 /*UserEditorType*/ ); editor.UserEditor( "Exontrol.ComboBox", "" ); EXCOMBOBOXLib::IComboBoxPtr spComboBox = editor.GetUserEditorObject(); if ( spComboBox != NULL ) { spComboBox->BeginUpdate(); spComboBox->LabelHeight = m_xmlgrid.GetNodeHeight() - 3; spComboBox->LinesAtRoot = EXCOMBOBOXLib::exLinesAtRoot; spComboBox->put_HeightList( vtMissing, 256 ); spComboBox->put_WidthList( vtMissing, 256 ); spComboBox->IntegralHeight = true; spComboBox->Columns->Add("Name"); spComboBox->Columns->Add("Value"); spComboBox->ColumnAutoResize = true; EXCOMBOBOXLib::IItemsPtr spItems = spComboBox->Items; long h = spItems->AddItem(COleVariant( "Item 1" )); spItems->put_CellCaption(COleVariant(h),COleVariant((long)1), COleVariant( "Item 1.2" ) ); long h1 = spItems->InsertItem(h, vtMissing, COleVariant( "SubItem 1") ); spItems->put_CellCaption(COleVariant(h1),COleVariant((long)1), COleVariant( "SubItem 1.2" ) ); h1 = spItems->InsertItem(h, vtMissing, COleVariant( "SubItem 2") ); spItems->put_CellCaption(COleVariant(h1),COleVariant((long)1), COleVariant( "SubItem 2.2" ) ); spItems->put_ExpandItem(h, true ); spComboBox->EndUpdate(); }
The sample requires the #import <excombobox.dll> to include the ExComboBox's type library. The #import <excombobox.dll> creates EXCOMBOBOXLib namespace that includes all definitions for objects and types that the ExComboBox control exports.
The following VB.NET sample adds an ActiveX editor, ( Exontrol's ExComboBox ):
With AxXMLGrid1.Editors With .Add("excombobox", EXMLGRIDLib.EditTypeEnum.UserEditorType) .UserEditor("Exontrol.ComboBox", "") With .UserEditorObject .BeginUpdate() .LabelHeight = AxXMLGrid1.NodeHeight - 3 .LinesAtRoot = True .HeightList = 256 .WidthList = 256 .IntegralHeight = True .Columns.Add("Name") .Columns.Add("Value") .ColumnAutoResize = True With .Items Dim h, h1 As Integer h = .AddItem("Item 1") .CellCaption(h, 1) = "Item 1.2" h1 = .InsertItem(h, , "SubItem 1") .CellCaption(h1, 1) = "SubItem 1.2" h1 = .InsertItem(h, , "SubItem 2") .CellCaption(h1, 1) = "SubItem 2.2" .ExpandItem(h) = True End With .EndUpdate() End With End With End With
The following C# sample adds an ActiveX editor, ( Exontrol's ExComboBox ):
EXMLGRIDLib.Editor editor = axXMLGrid1.Editors.Add("excombobox", EXMLGRIDLib.EditTypeEnum.UserEditorType); editor.UserEditor("Exontrol.ComboBox", ""); EXCOMBOBOXLib.ComboBox comboBox = editor.UserEditorObject as EXCOMBOBOXLib.ComboBox; if ( comboBox != null ) { comboBox.BeginUpdate(); comboBox.LabelHeight = axXMLGrid1.NodeHeight - 3; comboBox.LinesAtRoot = EXCOMBOBOXLib.LinesAtRootEnum.exLinesAtRoot ; comboBox.set_HeightList( null, 256 ); comboBox.set_WidthList( null, 256 ); comboBox.IntegralHeight = true; comboBox.Columns.Add("Name"); comboBox.Columns.Add("Value"); comboBox.ColumnAutoResize = true; EXCOMBOBOXLib.Items items = comboBox.Items; int h = items.AddItem("Item 1"); items.set_CellCaption(h, 1, "Item 1.2" ); int h1 = items.InsertItem(h, null, "SubItem 1"); items.set_CellCaption(h1, 1,"SubItem 1.2"); h1 = items.InsertItem(h, null, "SubItem 2"); items.set_CellCaption(h1, 1,"SubItem 2.2"); items.set_ExpandItem(h, true); comboBox.EndUpdate(); }
In C# your project needs a new reference to the Exontrol's ExComboBox control library. Use the Project\Add Reference\COM item to add new reference to a COM object. Once that you added a reference to the Exontrol's ExComboBox the EXCOMBOBOXLib namespace is created. The EXCOMBOBOXLib namespace contains definitions for all objects that ExComboBox control exports.
The following VFP sample adds an ActiveX editor, ( Exontrol's ExComboBox ):
With thisform.XMLGrid1.Editors With .Add("excombobox", 16) && UserEditorType .UserEditor("Exontrol.ComboBox", "") With .UserEditorObject .BeginUpdate .LabelHeight = thisform.XMLGrid1.NodeHeight - 3 .LinesAtRoot = -1 .HeightList(0) = 256 .WidthList(0) =256 .IntegralHeight = .t. .Columns.Add ("Name") .Columns.Add ("Value") .ColumnAutoResize = .t. With .Items .DefaultItem = .AddItem("Item 1") h = .DefaultItem .CellCaption(0, 1) = "Item 1.2" .DefaultItem = .InsertItem(h, , "SubItem 1") .CellCaption(0, 1) = "SubItem 1.2" .DefaultItem = .InsertItem(h, , "SubItem 2") .CellCaption(0, 1) = "SubItem 2.2" .DefaultItem = h .ExpandItem(0) = .t. EndWith .EndUpdate EndWith EndWith EndWith