Hello,
I have an embedded editor in an UltraWinGrid and would like to know if it possible to hide the control.
I know I can set the cell's hidden value to false but this does not give me the desired affect as we have other functionality that no longer functions if the cell is hidden.
Below is an example piece of code I tried and while it does return to me the RenderingControl setting Visible = false has no affect. Also, we have no EditorControl on this form as it is not needed.
MyControlContainer myControlContainer = (MyControlContainer)ultraGridCellPlayerName.Editor;MyControl myControl = (MyControl)myControlContainer.RenderingControl;myControl.Visible = false;
Thanks in advance!
Hello Anthony,
Thank you for contacting Infragistics. One possible approach is to set the RenderingControl to a new instance of UltraTextEditor and make it look like a regular cell and/or make it look disabled as an example, rather than hiding it. Otherwise you can simply set the RenderingControl to null to remove it. Then you an reassign the editor back when needed.
Under what condition do you require the rendering control to be hidden?
If you don't have an editing control does that mean you don't allow editing of the cells?
Let me know if you have any questions regarding this matter.
Sincerely,
Michael Di FilippoAssociate Software DeveloperInfragistics, Inc.www.infragistics.com/support
The rendering control gets hidden when the user drags the cell to another grid. We have no editing control as the control is read only.
I am currently using the following code to remove the rendering control which works and appears to provide good performance, just wasn't sure if there was something I was missing.
ultraGridCell.Editor = null; ultraGridCell.Value = null; ultraGridCell.Appearance.BorderColor = Color.Empty; //we are changing the border of cells which contain a control.
I've actually noticed an issue with this approach.
Setting the Editor or RenderingControl = null does not remove the user object.
In my form it is possible for the user to refresh the grid and we are seeing user object count spikes.
How can I remove the user object?
Ah yes, that was foolish of me. I didn't realize I was creating a new instance each time and fixed the code. I am good now. Thanks!
Are you reusing the same instance of the controls or creating new ones all the time? If you aren't using the same instance of the control, then that might solve the issue with leaking memory. If you do need to continually use a new instance, you might need to dispose the controls when they are no longer in use.