User (Old forums)MemberJanuary 26, 2012 at 8:05 pmPost count: 23064
I’m trying to update the items in a combo box in one cell, based off the value of a combobox in another cell. In the ActivatingControl event. I’ve tried adding and removing items from the WinComboBox returned by the CellEditorEventArgs.Control but I receive an error saying that the datasource does not support insertion or deletion. I get the same thing when attempting to remove items from the CellEditorEventArgs.Cell.CellEditorManager. I’ve also tried to update the datasource directly, which doesn’t error but doesn’t update the combo box either.
I’m setting up the combo box as follows:
SortedList<int, String> prodList = oApplication.getProductList();
new Size(g.Columns.Width * 2, 150);
cbprod.TemplateControl.DropDownControl.Columns.VisibleIndex = 1;
].CellEditorManager = cbprod;
].CellViewerManager = new Xceed.Grid.Viewers.ComboBoxViewer(prodList.ToList(), “”, “Value”, “%Value%, %Key%”);
g.Columns.CellEditorManager.ActivatingControl += AppProduct_ActivatingControl;
g.Columns.CellEditorManager.DeactivatingControl += AppProduct_DeactivatingControl;
Since I’ve tried 4 different ways of adding and removing items as described above, I didn’t include that code here. I was hoping to get some suggestions on how to do it with the setup I posted above.
Imported from legacy forums. Posted by Leo (had 1602 views)Xceed SupportMemberJanuary 30, 2012 at 11:52 amPost count: 5658
Just to better understand the issue, are you able to send me a small self contained sample application so that I can investigate it further? My goal is to understand and see how your application will look like with the data in the GridControl and what possible real-life values will the Grid be populated with. With your sample, I will be able to provide you with an answer that is tailored to your specific means.
Imported from legacy forums. Posted by Marc [Xceed] (had 266 views)User (Old forums)MemberFebruary 1, 2012 at 6:03 pmPost count: 23064
I worked up a quick simple example. Hopefully it’ll help you understand what I’m trying to do.
Imported from legacy forums. Posted by Leo (had 284 views)Xceed SupportMemberFebruary 3, 2012 at 1:43 pmPost count: 5658
After reviewing your sample, I noticed that the code for the ActivatingControl/DeactivatingControl was not included. Are you able to send me your updated sample? In theory and practice, you should be able to extract the source of the ComboBox from the ActivatingControl (because you have access to the actual instance) and replace the source with a modified collection.
I do have 1 question for you. When you say that you want the value of one ComboBox to affect the ComboBox in another cell, are you talking about:
– another cell in a different column, same row?
– another cell in the same column, different row?
Imported from legacy forums. Posted by Marc [Xceed] (had 249 views)User (Old forums)MemberFebruary 4, 2012 at 7:11 pmPost count: 23064
Hey Marc, I did have that code in there so I think I sent the wrong zip. I’ve attached the sample again, let me know if it’s the right one.
I am trying to update a cell in different column in the same row.
Imported from legacy forums. Posted by Leo (had 249 views)Xceed SupportMemberFebruary 6, 2012 at 4:26 pmPost count: 5658
After looking at your sample application, I was noticing that in the ActivatingControl event, you were checking to see if the ComboBox in the last column had a SelectedItem. The only issue is that the control was always null. You are also going to need to localize your ComboBoxes and assign them different data sources. I have updated your sample application to show the changes.
Imported from legacy forums. Posted by Marc [Xceed] (had 1326 views)
- You must be logged in to reply to this topic.