[DevExpress]根据行,列索引来获取RepositoryItem

关键代码:

        /// <summary>

        /// 根据行,列索引来获取RepositoryItem

        /// </summary>

        /// <param name="view">GridView</param>

        /// <param name="rowIndex">行索引</param>

        /// <param name="columnIndex">列索引</param>

        /// <returns>RepositoryItem</returns>

        public static RepositoryItem GetRepositoryItem(this GridView view, int rowIndex, int columnIndex)

        {

            GridViewInfo _viewInfo = view.GetViewInfo() as GridViewInfo;

            GridDataRowInfo _viewRowInfo = _viewInfo.RowsInfo.FindRow(rowIndex) as GridDataRowInfo;

            return _viewRowInfo.Cells[columnIndex].Editor;

        }
希望有所帮助!

你可能感兴趣的:(repository)