Example #1
0
        private int letterBar_IndexToValue(object sender, Resco.Controls.ScrollBar.ScrollBarExtensionBase.ValueIndexConversionEventArgs e)
        {
            // get datasource, return if not found
            //DataView dv = alCustomers.DataSource as DataView;
            //if (dv == null)
            //    return -1;

            //// get DataTable
            //DataTable dt = dv.Table as DataTable;
            //if (dt == null)
            //    return -1;

            //// find all rows which starts with the selected letter
            //DataRow[] rows = dt.Select("CompanyName LIKE '" + letterBar.IndexToLetter(e.Parameter) + "%'", "CompanyName");
            //if (rows.Length > 0)
            //{
            //    // get the position of the first row
            //    int position = dv.Find(Convert.ToString(rows[0]["CompanyName"]));

            //    // uncomment this line to select the row
            //    //alCustomers.ActiveRowIndex = position;

            //    // ensure visible the row and do not update scrollbar value
            //    alCustomers.EnsureVisible(position, true);
            //}

            // return -1 to not update ScrollBar.Value
            return(-1);
        }
Example #2
0
        private int letterBar_ValueToIndex(object sender, Resco.Controls.ScrollBar.ScrollBarExtensionBase.ValueIndexConversionEventArgs e)
        {
            // get the row at the ScrollBar value
            //Resco.Controls.AdvancedList.Row row = alCustomers.DataRows[alCustomers.TopRowIndex];
            //if (row == null)
            //    return -1;

            //string text = Convert.ToString(row["CompanyName"]);
            //if (text.Length > 0)
            //{
            //    return letterBar.LetterToIndex(text[0]);
            //}

            return(-1);
        }