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.
I'm afraid I am not following you. As I said in my previous post, nothing you do to the EditorControl is going to affect the grid. All you need to do here is set the Value of the grid cell. You seem to be doing that.
pmorin said:If i dont add it into CheckedRows, i have to activate my cell fro grid push value into checkedrows collection.
I don't understand what this means. If the cell is not active, then the cell will display text indicating that multiple values are selected. You cannot see the dropdown list or the CheckedRows. Are you trying to access the CheckedRows of the combo control? You should not be doing that, because that collection will not accurately reflect what is in the grid. It cannot possibly do so, since there are multiple cells int he grid and only one combo control.