on InitializeRowEvent I assign UltraControlContainerEditor to EditorComponent of cell. its added successfully. but the problem is that control show only when we mouse over it or click on sell.
e.g dropdown or any control .
i am adding in following way .
UltraControlContainerEditor uce= new UltraControlContainerEditor();
Infragistics.Win.UltraWinEditors.UltraComboEditor cmb = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
cmb.Items.Add(lstItem);
cmb.DropDownStyle = DropDownStyle.DropDownList;
uce.EditingControl = (Control)cmb
e.Row.Cells["Answer"].EditorComponent = uce;
What kind of UI are you trying to acheive here?
In your original post, you were just setting the EditingControl to an UltraComboEditor, but that doesn't really make sense, since UltraComboEditor is already an editor. If you just want a dropdown list like an UltraComboEditor in a cell, then you do not need UltraControlContainerEditor, you can use a ValueList. In your subsequent post, you are creating the UltraComboEditor and binding the list and also setting a bunch of properties on it, but many of those properties are irrelevant to the grid, like the Tag.
I think you might be making things a lot more complicated than they need to be. Maybe what you want here is to either assign the UltraComboEditor directly to the cell:
Dim uce as UltraComboEditor = CreateMOList(e.Row.Cells["CarePlanQuestionId"].Value.ToSafeString(), out hasChildCarePlan, "MO", out NumberOfChildCarePlans);
e.Row.Cells["Answer"].EditorComponent = uce
Or perhaps even just creating a BindableValueList and binding it to the data you want.
You only need UltraControlContainerEditor if you want to embed a UserControl or something complicated like that. You do not need it if you just need a dropdown list in the column or if you are doing something that can be achieved by any of the existing editors.
Hi Mike. Thank you response me. Yes u are absolutely right. In original mistakenly mentioned drop down control. The main point was embedding user control in cell which should be editable and render. And show always without click on cell.
My requirements is that I need to show more than one checkboxes in one cell.number of checkbox depend on our database table record. It's dymanic.thats why i wanted use user control. Which should be editable,
Another requirement is that i need show star rating control also. Which should be editable.
No... as I explained.. the RenderingControl is used for every cell that is not in edit mode. The grid has to update the Value on the RenderingControl every time it needs to paint a cell. So you need to make sure your RenderingControl is as efficient as possible, because it's going to have it's property set a lot!
Thank you MikeSaltzman ,
your answer really helped me . i did like u said .its working fine now .
i just notice that RendererValue property always call it self automatically every second. if we put debug on rendering property which is override .
protected override object RendererValue {}. that one.
this can make performance slow . is there any way to let this property call only when we change on EditingControl?
Okay... so in that case, you have to set both the EditingControl AND the RenderingControl. You need to create two instances of your usercontrol and assign one to each of those properties.
The grid uses the RenderingControl to paint the cells that are not in edit mode. It basically draws the cell by applying that cells value to the RenderingControl, taking a snapshot of that control (DrawToBitmap) and then draws that cell with the image of the control.
The EditingControl is only used for the cell that is currently in edit mode in the grid.
You need two controls because you could have a cell that is in edit mode and still need to paint another cell or cells that are not in edit mode.