ComponentOne DataGrid for WPF and Silverlight
C1.WPF.DataGrid Namespace / DataGridColumn Class / BindCellContent Method
Visual element that will be bound in order to display the cell content. If the cellContent received is not the expected you'll probably need to override the method GetCellContentRecyclingKey.
Row for which the cell will be initialized.
Example

In This Topic
    BindCellContent Method (DataGridColumn)
    In This Topic
    Initializes the cell content presenter.
    Syntax
    'Declaration
     
    
    Public Overridable Sub BindCellContent( _
       ByVal cellContent As FrameworkElement, _
       ByVal row As DataGridRow _
    ) 
    public virtual void BindCellContent( 
       FrameworkElement cellContent,
       DataGridRow row
    )

    Parameters

    cellContent
    Visual element that will be bound in order to display the cell content. If the cellContent received is not the expected you'll probably need to override the method GetCellContentRecyclingKey.
    row
    Row for which the cell will be initialized.
    Remarks

    This method must include cellContent property settings, SetBinding of the corresponding dependency property being "row.DataItem" the source which can be set directly in the binding or as DataContext of the cellContent.

    This method is called after a cell content is created or a recycled one is taken.

    Example
    var txt = (TextBlock)cellContent;
                txt.HorizontalAlignment = HorizontalAlignment;
                txt.VerticalAlignment = VerticalAlignment;
                Binding newBinding = CopyBinding(Binding);
                newBinding.Source = row.DataItem;
                txt.SetBinding(TextBlock.TextProperty, newBinding);
    See Also