DataGridTemplateColumn.GenerateElement Method
Gets an element defined by the CellTemplate 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)
Parameters
- cell
- Type: System.Windows.Controls.DataGridCell
The cell that will contain the generated element.
- dataItem
- Type: System.Object
The data item represented by the row that contains the intended cell.
Return Value
Type: System.Windows.FrameworkElementA new, read-only element that is bound to the column's Binding property value.
| Exception | Condition |
|---|---|
| TypeInitializationException |
The CellTemplate is null. |
This method is called internally when the DataGrid populates the contents of a cell in the column when the cell is in editing mode. This method creates and configures a new read-only element defined by the CellTemplate, and binds the appropriate dependency property to the column's Binding property value.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.