I want to set EditorWithCombo editor to the cells of a column. But the list items of the combo boxes are different. How can I manage the ValueList in this case?
Typically one handles the BeforeCellEnterEditMode event, and changes the contents of the associated ValueList therein.
Sorry, but this is not fully correct.As it will change the values of other cells.I am also having this situation...
Imagine, I would like my first node combo to have values {1,2}, and the second node {a,b}So I cannot assign a valuelist to the column, as either the first or the second node cell will show empty value.How can I solve this problem?
Hi Mike,
Sorry for late answer, but finally I could try your hint, and it works as I expected, brilliant!
Thanks!
Hi,
Sorry for the confusion. I'm so used to answering grid questions, I didn't even notice I was in the WinTree forum.
What you really need to do here is assign a ValueList to the cell and not the column. You could, in theory, dynamically assign a different ValueList to the column based on which node is active, but this is not a good idea, because the tree will need the ValueList to convert from DisplayText to DataValue and vice versa. And if the original ValueList is not there, it will cause a problem.
As far as I can tell, there is no ValueList property on the tree cell like there is on the WinGrid cell. But there is an Editor property.
So what I would do is create an UltraComboEditor control for each of the possible lists you need and set the EditorComponent property on the cell (not the column) to that UltraComboEditor. This will provide a different list for each cell individually.
Thanks Mike,
But I think our situation is a bit different:we have a tree and not a grid on the form, and there is no real DB binded to the tree, it's just filled manually.
It's a multi-column tree, created as ColumnSettings.ColumnSets.Add(colSet).Then later
ValueList vl = new ValueList();vl.ValueListItems.Add("V", "V");... _treeLayout.ColumnSettings.ColumnSets[0].Columns["Layout"].ValueList = vl;_treeLayout.ColumnSettings.ColumnSets[0].Columns["Layout"].Editor = new Infragistics.Win.EditorWithCombo(new ComboListEditorOwner());With this, all rows in the "Layout" column have the same items in the combo.But for some rows, I want totally different items in that Combo, which are nothing common with the rest of the combobox.I tried to assign an other valuelist to the Layout column in the BeforeCellEnterEditMode (based on the current row), but this made the rest of the Row values null - if their current value was not in the new valuelist, and that's what I want, totally different valuelist.Let's say, odd rows have {"a", "b"} in their combobox in the Layout column, the rest have {"x", "y"}
This article should help you achieve what you need:
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community