BrightIdeasSoftware.ObjectListView.FindMatchInRange C# (CSharp) Method

FindMatchInRange() protected method

Find the first row in the given range of rows that prefix matches the string value of the given column.
protected FindMatchInRange ( string text, int first, int last, OLVColumn column ) : int
text string
first int
last int
column OLVColumn
return int
        protected virtual int FindMatchInRange(string text, int first, int last, OLVColumn column)
        {
            if (first <= last) {
                for (int i = first; i <= last; i++) {
                    string data = column.GetStringValue(this.GetNthItemInDisplayOrder(i).RowObject);
                    if (data.StartsWith(text, StringComparison.CurrentCultureIgnoreCase))
                        return i;
                }
            } else {
                for (int i = first; i >= last; i--) {
                    string data = column.GetStringValue(this.GetNthItemInDisplayOrder(i).RowObject);
                    if (data.StartsWith(text, StringComparison.CurrentCultureIgnoreCase))
                        return i;
                }
            }

            return -1;
        }
ObjectListView