| Visual Basic (Declaration) | |
|---|---|
Public Property CurrentItem As Object | |
| C# | |
|---|---|
public object CurrentItem {get; set;} | |
Return Value
A reference to the grid's current master data item. Can be a null reference (Nothing in Visual Basic) if the current item is not a master data item.All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise.
The following example demonstrates how to retrieve the value of the ShipCountry and ShipCity properties of the current item and display them in TextBlocks located above the grid. Note that an item in a grid must be current in order for the information to be displayed.
| XAML | Copy Code |
|---|---|
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"> | |
The CurrentItem and SelectedItem properties may, or may not, be the same data item.
The CurrentItem and SelectedItem/SelectedItems properties must be set to a null reference (Nothing in Visual Basic) in order to reset them when the NavigationBehavior property is set to None.
Supported Frameworks: Microsoft .NET Framework version 3.5
Copy Code