BrightIdeasSoftware.ObjectListView.CalculateCellEditorBoundsOwnerDrawn C# (CSharp) Method

CalculateCellEditorBoundsOwnerDrawn() protected method

Calculate the bounds of the edit control for the given item/column, when the listview is being owner drawn.
protected CalculateCellEditorBoundsOwnerDrawn ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle r, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
r System.Drawing.Rectangle
preferredSize System.Drawing.Size
return System.Drawing.Rectangle
        protected Rectangle CalculateCellEditorBoundsOwnerDrawn(OLVListItem item, int subItemIndex, Rectangle r, Size preferredSize)
        {
            IRenderer renderer = this.View == View.Details
                                     ? (this.GetColumn(subItemIndex).Renderer ?? this.DefaultRenderer)
                                     : this.ItemRenderer;

            if (renderer == null)
                return r;

                using (Graphics g = this.CreateGraphics()) {
                return renderer.GetEditRectangle(g, r, item, subItemIndex, preferredSize);
                }
        }
ObjectListView