Home › Forums › WinForms controls › Xceed Grid for WinForms › trouble using GridComboBox as CellViewer
-
AuthorPosts
-
hey, thanks for the reply.
I ended up figuring that out but I can not get the data to display in the grid combo box when in view mode. It is alway blank which is the first option in the combo.
When you click the cell it switches to edit mode and the correct data is displayed as soon as you move out of edit mode the blank combo is displayed again.
???
Any ideas?Cheers
AdamImported from legacy forums. Posted by RayMartinsHair (had 641 views)
I should also mention that we are using version 2.5 of the grid.
I downloaded version 3.x of the grid today and was able to get the functionality working using the below code.
// Create the combo’s for edit and view (
Xceed.Grid.Editors.GridComboBox editCombo = CreateOutcomeEditor();
// set the view as the combo box only if the control is enabled ie they user is able to update the grid
if(!ucAssistance.ReadOnly)
{
// create and assign CellEditorManager class to the column
this.ucAssistance.Columns[2].CellEditorManager = new Xceed.Grid.Editors.CellEditorManager(editCombo,”Text”,true, true);
// clone the template control for use in the cell viewer
Control cloneCombo = Xceed.UI.ThemedControl.CloneControl(this.ucAssistance.Columns[2].CellEditorManager.TemplateControl);
// create and assign CellViewerManager class to the column
this.ucAssistance.Columns[2].CellViewerManager = new Xceed.Grid.Viewers.CellViewerManager(cloneCombo, “Text”);}
this still doesn’t help me as the we are not able to use version 3 of the .Net grid for this release. ;-(
any ideas?
Cheers
AdamImported from legacy forums. Posted by RayMartinsHair (had 583 views)
For your gridcombobox declared as,
GridComboBox _gridViewer = new GridComboBox();
Make sure that you have done the following things.
1. Add the control to the form controls collection,
this.Controls.Add(_gridViewer);
2, A tip from xceed support, This is very important, set the left and top to this values, this is probably why your data is not showing because the orignal grid viewer is covering it
_gridViewer.Left = -1000;
_gridViewer.Top = -1000;3. that you have added the list of items, or bind the datasource
_gridViewer.Items.Add(“testdata”)’
do the above in the code between grid.BeginInit and grid.EndInit
Imported from legacy forums. Posted by userX (had 383 views)
yep that fixed it.
thanks heaps 😉
Cheers
AdamImported from legacy forums. Posted by RayMartinsHair (had 12184 views)
-
AuthorPosts
- You must be logged in to reply to this topic.