문제

Should I dispose XtraGrid elements if it was created in code (f.ex.: If I add EmptySpaceItem in LayoutView)? Or GC collects it?

도움이 되었습니까?

해결책

Basiclly, No. The GC does that for you.

Because the GridControl is itself a control, it is stored in the forms Controls collection. It will be disposed then the form is disposed.

XtraGrid is itself responsible for disposing any objects that lives in the Grid.

If you were to add a custom event/property to the XtraGrid, when you are resonsible for cleanling up when disposed is called. But it is not the case in your senario.

다른 팁

The Garbage Collector will do any neccesary work for you :-) He search for unuseable Objects if your program dont work or if the memory becomes empty and delete them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top