Share via


DataGrid Properties

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

The DataGrid type exposes the following members.

Properties

  Name Description
Public property ActualHeight Gets the rendered height of a FrameworkElement. (Inherited from FrameworkElement.)
Public property ActualWidth Gets the rendered width of a FrameworkElement. (Inherited from FrameworkElement.)
Public property AllowDrop Gets or sets a value that determines whether this UIElement can be a drop target for purposes of Silverlight drag-and-drop operations. (Inherited from UIElement.)
Public property AlternatingRowBackground Gets or sets the Brush that is used to paint the background of odd-numbered rows.
Public property AreRowDetailsFrozen Gets or sets a value that indicates whether the row details sections remain fixed at the width of the display area or can scroll horizontally.
Public property AreRowGroupHeadersFrozen Gets or sets a value that indicates whether the row group header sections remain fixed at the width of the display area or can scroll horizontally.
Public property AutoGenerateColumns Gets or sets a value that indicates whether columns are created automatically when the ItemsSource property is set.
Public property Background Gets or sets a brush that provides the background of the control. (Inherited from Control.)
Public property BorderBrush Gets or sets a brush that describes the border background of a control. (Inherited from Control.)
Public property BorderThickness Gets or sets the border thickness of a control. (Inherited from Control.)
Public property CacheMode Gets or sets a value that indicates that rendered content should be cached when possible. (Inherited from UIElement.)
Public property CanUserReorderColumns Gets or sets a value that indicates whether the user can change the column display order by dragging column headers with the mouse.
Public property CanUserResizeColumns Gets or sets a value that indicates whether the user can adjust column widths using the mouse.
Public property CanUserSortColumns Gets or sets a value that indicates whether the user can sort columns by clicking the column header.
Public property CellStyle Gets or sets the style that is used when rendering the data grid cells.
Public property CharacterSpacing Gets or sets the distance between characters of text in the control measured in 1000ths of the font size. (Inherited from Control.)
Public property Clip Gets or sets the Geometry used to define the outline of the contents of a UIElement. (Inherited from UIElement.)
Public property ClipboardCopyMode Gets or sets a value that indicates how data is copied to the clipboard.
Public property ColumnHeaderHeight Gets or sets the height of the column headers row.
Public property ColumnHeaderStyle Gets or sets the style that is used when rendering the column headers.
Public property Columns Gets a collection that contains all the columns in the control.
Public property ColumnWidth Gets or sets the standard width or automatic sizing mode of columns in the control.
Public property CurrentColumn Gets or sets the column that contains the current cell.
Protected property CurrentItem Gets the data item bound to the row that contains the current cell.
Public property Cursor Gets or sets the cursor image that displays while the mouse pointer is over a FrameworkElement. (Inherited from FrameworkElement.)
Public property DataContext Gets or sets the data context for a FrameworkElement when it participates in data binding. (Inherited from FrameworkElement.)
Protected property DefaultStyleKey Gets or sets the key that references the default style for the control. (Inherited from Control.)
Public property DesiredSize Gets the size that this UIElement computed during the measure pass of the layout process. (Inherited from UIElement.)
Public property Dispatcher Gets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public property DragIndicatorStyle Gets or sets the style that is used when rendering the drag indicator that is displayed while dragging column headers.
Public property DropLocationIndicatorStyle Gets or sets the style that is used when rendering the column headers.
Public property Effect Gets or sets the pixel shader effect to use for rendering this UIElement. (Inherited from UIElement.)
Public property FlowDirection Gets or sets the direction that text and other user interface elements flow within any parent element that controls their layout. (Inherited from FrameworkElement.)
Public property FontFamily Gets or sets the font used to display text in the control. (Inherited from Control.)
Public property FontSize Gets or sets the size of the text in this control. (Inherited from Control.)
Public property FontStretch Gets or sets the degree to which a font is condensed or expanded on the screen. (Inherited from Control.)
Public property FontStyle Gets or sets the style in which the text is rendered. (Inherited from Control.)
Public property FontWeight Gets or sets the thickness of the specified font. (Inherited from Control.)
Public property Foreground Gets or sets a brush that describes the foreground color. (Inherited from Control.)
Public property FrozenColumnCount Gets or sets the number of columns that the user cannot scroll horizontally.
Public property GridLinesVisibility Gets or sets a value that indicates which grid lines separating inner cells are shown.
Public property HeadersVisibility Gets or sets a value that indicates the visibility of row and column headers.
Public property Height Gets or sets the suggested height of a FrameworkElement. (Inherited from FrameworkElement.)
Public property HorizontalAlignment Gets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control. (Inherited from FrameworkElement.)
Public property HorizontalContentAlignment Gets or sets the horizontal alignment of the control's content. (Inherited from Control.)
Public property HorizontalGridLinesBrush Gets or sets the Brush that is used to paint grid lines separating rows.
Public property HorizontalScrollBarVisibility Gets or sets a value that indicates how the horizontal scroll bar is displayed.
Public property IsEnabled Gets or sets a value indicating whether the user can interact with the control. (Inherited from Control.)
Public property IsHitTestVisible Gets or sets whether the contained area of this UIElement can return true values for hit testing. (Inherited from UIElement.)
Public property IsReadOnly Gets or sets a value that indicates whether the user can edit the values in the control.
Public property IsTabStop Gets or sets a value that indicates whether a control is included in tab navigation. (Inherited from Control.)
Public property IsValid Gets a value that indicates whether data in the grid is valid.
Public property ItemsSource Gets or sets a collection that is used to generate the content of the control.
Public property Language Gets or sets localization/globalization language information that applies to a FrameworkElement. (Inherited from FrameworkElement.)
Public property Margin Gets or sets the outer margin of a FrameworkElement. (Inherited from FrameworkElement.)
Public property MaxColumnWidth Gets or sets the maximum width of columns in the DataGrid.
Public property MaxHeight Gets or sets the maximum height constraint of a FrameworkElement. (Inherited from FrameworkElement.)
Public property MaxWidth Gets or sets the maximum width constraint of a FrameworkElement. (Inherited from FrameworkElement.)
Public property MinColumnWidth Gets or sets the minimum width of columns in the DataGrid.
Public property MinHeight Gets or sets the minimum height constraint of a FrameworkElement. (Inherited from FrameworkElement.)
Public property MinWidth Gets or sets the minimum width constraint of a FrameworkElement. (Inherited from FrameworkElement.)
Public property Name Gets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name. (Inherited from FrameworkElement.)
Public property Opacity Gets or sets the degree of the object's opacity. (Inherited from UIElement.)
Public property OpacityMask Gets or sets the brush used to alter the opacity of regions of this object. (Inherited from UIElement.)
Public property Padding Gets or sets the padding inside a control. (Inherited from Control.)
Public property Parent Gets the parent object of this FrameworkElement in the object tree. (Inherited from FrameworkElement.)
Public property Projection Gets or sets the perspective projection (3-D effect) to apply when rendering this UIElement. (Inherited from UIElement.)
Public property RenderSize Gets the final render size of a UIElement. (Inherited from UIElement.)
Public property RenderTransform Gets or sets transform information that affects the rendering position of a UIElement. (Inherited from UIElement.)
Public property RenderTransformOrigin Gets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement. (Inherited from UIElement.)
Public property Resources Gets the locally defined resource dictionary. In XAML, you can establish resource items as child object elements of a frameworkElement.Resources property element, through XAML implicit collection syntax. (Inherited from FrameworkElement.)
Public property RowBackground Gets or sets the Brush that is used to paint row backgrounds.
Public property RowDetailsTemplate Gets or sets the template that is used to display the content of the details section of rows.
Public property RowDetailsVisibilityMode Gets or sets a value that indicates when the details sections of rows are displayed.
Public property RowGroupHeaderStyles Gets the style that is used when rendering the row group header.
Public property RowHeaderStyle Gets or sets the style that is used when rendering the row headers.
Public property RowHeaderWidth Gets or sets the width of the row header column.
Public property RowHeight Gets or sets the standard height of rows in the control.
Public property RowStyle Gets or sets the style that is used when rendering the rows.
Public property SelectedIndex Gets or sets the index of the current selection.
Public property SelectedItem Gets or sets the data item corresponding to the selected row.
Public property SelectedItems Gets a list that contains the data items corresponding to the selected rows.
Public property SelectionMode Gets or sets the selection behavior of the data grid.
Public property Style Gets or sets an instance Style that is applied for this object during rendering. (Inherited from FrameworkElement.)
Public property TabIndex Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key. (Inherited from Control.)
Public property TabNavigation Gets or sets a value that modifies how tabbing and TabIndex work for this control. (Inherited from Control.)
Public property Tag Gets or sets an arbitrary object value that can be used to store custom information about this object. (Inherited from FrameworkElement.)
Public property Template Gets or sets a control template. (Inherited from Control.)
Public property Triggers Gets the collection of triggers for animations that are defined for a FrameworkElement. (Inherited from FrameworkElement.)
Public property UseLayoutRounding Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels. (Inherited from UIElement.)
Public property VerticalAlignment Gets or sets the vertical alignment characteristics that are applied to a FrameworkElement when it is composed in a parent object such as a panel or items control. (Inherited from FrameworkElement.)
Public property VerticalContentAlignment Gets or sets the vertical alignment of the control's content. (Inherited from Control.)
Public property VerticalGridLinesBrush Gets or sets the Brush that is used to paint grid lines separating columns.
Public property VerticalScrollBarVisibility Gets or sets a value that indicates how the vertical scroll bar is displayed.
Public property Visibility Gets or sets the visibility of a UIElement. A UIElement that is not visible does not render and does not communicate its desired size to layout. (Inherited from UIElement.)
Public property Width Gets or sets the width of a FrameworkElement. (Inherited from FrameworkElement.)

Top