Exemplo n.º 1
0
        /// <summary>
        /// Finds the first <see cref="RowSelectorColumn"/> in the given <see cref="DataGrid"/> after or at the given column index.
        /// </summary>
        /// <param name="grid">The <see cref="DataGrid"/> to search.</param>
        /// <param name="startIndex">The index of the column to start the search.</param>
        /// <returns>The <see cref="RowSelectorColumn"/> found, or null.</returns>
        public static RowSelectorColumn FindColumn(DataGrid grid, Int32 startIndex)
        {
            RowSelectorColumn foundCol = null;

            for (Int32 i = startIndex; i < grid.Columns.Count; i++)
            {
                foundCol = grid.Columns[i] as RowSelectorColumn;
                if (foundCol != null)
                {
                    return(foundCol);
                }
            }
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Finds the first <see cref="RowSelectorColumn"/> in the given <see cref="DataGrid"/>.
        /// </summary>
        /// <param name="grid">The <see cref="DataGrid"/> to search.</param>
        /// <returns>The <see cref="RowSelectorColumn"/> found, or null.</returns>
        public static RowSelectorColumn FindColumn(DataGrid grid)
        {
            RowSelectorColumn foundCol = null;

            foreach (DataGridColumn col in grid.Columns)
            {
                foundCol = col as RowSelectorColumn;
                if (foundCol != null)
                {
                    return(foundCol);
                }
            }
            return(null);
        }