Hi,
I am using the editor component of a cell and setting it to a UltraComboEditor that I create in that form and setting it's DataSource equal to a generic list.
To get the datasource to work, I am adding the control to the Controls collection. The only issue is that the control is then being dumped on the form as well. I only want it to show on my grid.
Am I missing something simple?
Is it enough for me to just say
CombEditorInstance.BindingContext = Form.BindingContext
?
Thanks,
M
Hello,
if you do not add control to the control collection of the Forms, then this control will not have BindingContext associate with it, and binding will not works properly for it. So you could set Visible property of your combo editor to false, in order to hide it from the user. It is always good practice to add controls to the controls collection of the Form, because Form is responsible for managing of the resources which control takes, and when the form was disposed, its components also will be disposed (this saves you from a possible memory leak and etc.).
Yes, you also could assign BindingContext to your combo as you said and it will works (I’ve already explained why), however I believe that better approach is to add this combo to the controls collection and to set it Visible property to false.
Also another possible approach to display dropdown in cell of, which I would like to mention UltraGrid, is to use ValueList. By using a ValueList you could easily attach a list with data to a specific cell.
I have implemented this suggestion in a simple sample which you could run and evaluate, please see attached zip.
Please let me know if you have any further questions.
Thanks.
It works fine. Just wondering...why if setting the visibility to false does it not hide it in the cell of the grid? Not that I want to, but I thought to set visible to false at first but never tried because I assumed it would just make it all false.
Michael
Hi Michael,
I am just checking about the progress of this issue. Let me know If you need our further assistance on this issue?
Thank you for using Infragistics Components.
No the answers here helped huge. I marked Mike's answer as the 'answer'.
Thanks,M.