Hi, i have a ultracombo configured with CheckedListSettings.
If i cast my UltraCombo into Infragistics.Win.ICheckedItemList and i check some item with method SetCheckState, the combo show my checked item.
If i use this combo as ComponentEditor into a UltraGridColumn. If i try this
(( Infragistics.Win.ICheckedItemList)((UltraCombo)e.Cell.Row.Cells["Option"].EditorComponentResolved)).SetCheckState(1, CheckState.Checked), the EditorComponent dont show the value.
Hi,
This doesn't work in the WinGrid for a couple of reasons. The main reason is that the combo doesn't know which cell in the grid you are trying to affect.
The grid does not use the control you supplied as the EditorComponent. The EditorComponent simply provides a copy of it's internal editor to the grid.
The checked or unchecked items in any dropdown in the grid are ultimately determined by the Value of the grid cell. So you will have to set the grid cell's Value to achieve what you want here.
Hi Matt, thanks for your answer
that is what i do
int taskId = (int)e.Cell.Value;int[] defaultOptionIds = (from optionRow in dataset.TaskOption.Select(string.Format("TaskId={0}", taskId)) select ((Datasets.TimeSheet.TaskOptionRow)optionRow).OptionId).ToArray();e.Cell.Row.Cells["Option"].SetValue(defaultOptionIds, false);((ICheckedItemList)e.Cell.Row.Cells["Option"].EditorComponentResolved).Value = defaultOptionIds;
I have set the cell value and added my int[] to CheckedRows Collection of my editor. If i dont add it into CheckedRows, i have to activate my cell fro grid push value into checkedrows collection.
Maybe its because my cell "option" is not in editmode when i set value.