C# Set the current row based on column names and values

黄舟
Release: 2017-02-20 11:11:30
Original
1425 people have browsed it

C# Set the current row based on the column name and column value

  /// <summary>
        /// 根据GridView中某列的值与列名来设置当前行
        /// </summary>
        /// <param name="gv">待设置当前行的GridView</param>
        /// <param name="FilterCellValue">某列的值</param>
        /// <param name="CellName">列名</param>
        public void SetFocusedRow(DevExpress.XtraGrid.Views.Grid.GridView gv, string FilterCellValue, string CellName)
        {
            for (int i = 0; i < gv.RowCount; i++)
            {
                if (FilterCellValue == gv.GetRowCellValue(i, CellName).ToString())
                {
                    gv.FocusedRowHandle = i;
                }
            }
        }
Copy after login

The above is the content of C# setting the current row based on the column name and column value. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!