SourceGrid.GridVirtual.RangeToRectangle C# (CSharp) Method

RangeToRectangle() public method

Returns the relative rectangle to the current scrollable area of the specified Range. Returns a Rectangle.Empty if the Range is not valid.
public RangeToRectangle ( Range range ) : Rectangle
range Range
return System.Drawing.Rectangle
        public Rectangle RangeToRectangle(Range range)
        {
            if (range.IsEmpty())
                return Rectangle.Empty;

            int x = Columns.GetLeft(range.Start.Column);
            int y = Rows.GetTop(range.Start.Row);

            Size size = RangeToSize(range);
            if (size.IsEmpty)
                return Rectangle.Empty;

            return new Rectangle(new Point(x, y), size);
        }