Xceed DataGrid for Silverlight Documentation
GetContainerFromItem Method (DataGridControl)
Example 


An object representing the item whose container is to be retrieved.
Retrieves the container for the specified item.
Syntax
'Declaration
 
Public Function GetContainerFromItem( _
   ByVal item As Object _
) As UIElement
'Usage
 
Dim instance As DataGridControl
Dim item As Object
Dim value As UIElement
 
value = instance.GetContainerFromItem(item)
public UIElement GetContainerFromItem( 
   object item
)

Parameters

item
An object representing the item whose container is to be retrieved.

Return Value

A UIElement representing the item's container.
Remarks
Only the data items that are visible in the viewport will have an associated container.
Example
Dim currentItem As Object = sldgDataGridControl.CurrentItem
Dim parentRow As DataRow = TryCast( sldgDataGridControl.GetContainerFromItem( currentItem ), DataRow )
parentRow.Cells( 0 ).BeginEdit()
object currentItem = sldgDataGridControl.CurrentItem;
DataRow parentRow = sldgDataGridControl.GetContainerFromItem(currentItem) as DataRow;
parentRow.Cells[ 0 ].BeginEdit();
Requirements

Target Platforms: Windows 7, Windows Vista, Windows XP SP3, Windows Server 2008 family

See Also

Reference

DataGridControl Class
DataGridControl Members
DataGridControl.GetContainerFromPath Method
DataGridControl.GetPathFromContainer Method
DataGridControl.GetPathFromItem Method

Additional Information

Paths and Containers

Send Feedback