In my Windows Form project I have a WinGrid that contains two columns each with dropdown menus.
The two columns (named Noun & Qualifier) share a parent sibling relationship respectively.
I created a ValueList containing the Nouns that will appear in the dropdowns of the NounsColumn and assigned it to the UltraGridColumn's ValueList property accordingly (the set of values in the dropdown for this column will never change). However since the value the user selects in the NounColumn dictates the set of data that will be loaded in the Qualifier column I would like ValueList property of the cell in the QualifierColumn to be set when the CellChange event is triggered on the NounsColumn.
I am already capturing the event however I am not sure how to reference the other cell (The one in the QualifierColumn) so that I may set it's ValueList property. I have done some research and found many people to suggest the following:
//Handler called when the user changes cell (used for the selection on the NounColumn dropdown) private void _cellChange_Edit(object sender, CellEventArgs e) { e.Cell.Row.Cells.GetItem("Qualifier"); //Assign the cell a given ValueList }
My only issue with this is that my version of the code does not support a GetItem(String) only a GetItem(Int32) (2007 Vol3 [CLR 2.0] v7.3.20073.1061) the link provided shows this documentation is for Build Version 7.3.20073.1043 I would assume since I applied hotfix 1063 I should still have support for the GetItem(String) method. I would use the GetItem(Int32) method however I need my grid to support having the users move the columns around therefore I can not rely on always passing in a index value for the Qualifier column.
What I really need is a way to reference the cell in my row that comes from the Qualifier column, that way I can update it's ValueList property to correctly reflect the values it should contain as a result of the parent selection.
If someone could please provide some direction with this issue I would greatly appreciate it. Perhaps there is an easier way to achive this parent sibling dropdown relationship perhaps you could provide some help with the GetItem(String) issue.
e.Cell.Row.Cells["Qualifier"].ValueList
Many thanks, this did exactly what I needed.