Condividi tramite


DataGridCheckBoxColumn.GenerateElement Method

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

Gets a read-only CheckBox control that is bound to the column's Binding property value.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

Syntax

'Declaration
Protected Overrides Function GenerateElement ( _
    cell As DataGridCell, _
    dataItem As Object _
) As FrameworkElement
protected override FrameworkElement GenerateElement(
    DataGridCell cell,
    Object dataItem
)

Parameters

  • dataItem
    Type: System.Object
    The data item represented by the row that contains the intended cell.

Return Value

Type: System.Windows.FrameworkElement
A new, read-only CheckBox control that is bound to the column's Binding property value.

Remarks

This method is called internally when the DataGrid populates the contents of a cell in the column when the cell is not in editing mode. This method creates and configures a read-only check box, and binds its IsCheckedProperty field to the column's Binding property value. The read-only check box is an internal class derived from CheckBox with overridden mouse and keyboard methods to prevent editing.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.