Intersoft.Client.UI.Data Namespace > UXGridView Class : ExpandedItem Property |
<CategoryAttribute("Row Details")> Public Property ExpandedItem As Object
Dim instance As UXGridView Dim value As Object instance.ExpandedItem = value value = instance.ExpandedItem
[CategoryAttribute("Row Details")] public object ExpandedItem {get; set;}
[CategoryAttribute("Row Details")] public: property Object^ ExpandedItem { Object^ get(); void set ( Object^ value); }
The following code shows how to create hierarchical grid view using row details.
XAML |
Copy Code
|
---|---|
<Intersoft:UXGridView AutoGenerateColumns="False" ExpandedItem="{Binding ExpandedItem, Mode=TwoWay}" EnableRowVirtualization="False" ItemsSource="{Binding Employees}"> <Intersoft:UXGridView.Columns> <Intersoft:UXGridViewExpanderColumn/> <Intersoft:UXGridViewTextColumn Header="Employee ID" Binding="{Binding EmployeeID}"/> <Intersoft:UXGridViewTextColumn Header="First Name" Binding="{Binding FirstName}"/> <Intersoft:UXGridViewTextColumn Header="Last Name" Binding="{Binding LastName}"/> <Intersoft:UXGridViewTextColumn Header="Title" Binding="{Binding Title}"/> </Intersoft:UXGridView.Columns> <Intersoft:UXGridView.RowDetailsTemplate> <DataTemplate> <Border Margin="0,1,1,1" Background="#FFF7F7F7" BorderBrush="#FFAFAFAF" BorderThickness="0,1,0,0"> <Grid> <Border BorderBrush="#FFAFAFAF" BorderThickness="1,0,0,1" HorizontalAlignment="Left" Width="20" VerticalAlignment="Top" Height="24" Margin="10,0,0,0"/> <Intersoft:UXGridView ItemsSource="{Binding Orders}" Margin="20,10,12,12" CanUserPage="True" PageSize="5" AutoGenerateColumns="False"> <Intersoft:UXGridView.Columns> <Intersoft:UXGridViewTextColumn Header="Order ID" Binding="{Binding OrderID}"/> <Intersoft:UXGridViewTextColumn Header="Order Date" Binding="{Binding OrderDate}"/> <Intersoft:UXGridViewTextColumn Header="Required Date" Binding="{Binding RequiredDate}"/> <Intersoft:UXGridViewTextColumn Header="Shipped Date" Binding="{Binding ShippedDate}"/> </Intersoft:UXGridView.Columns> </Intersoft:UXGridView> </Grid> </Border> </DataTemplate> </Intersoft:UXGridView.RowDetailsTemplate> </Intersoft:UXGridView> |
The above code shows how to define the row details to create hierarchical grid view and bind the ExpandedItem property to the ViewModel. In the ViewModel, you write a custom logic to load the child data whenever the ExpandedItem property is set.
CS |
Copy Code
|
---|---|
public object ExpandedItem { get { return this._expandedItem; } set { if (this._expandedItem != value) { this._expandedItem = value; this.OnPropertyChanged("ExpandedItem"); // this.LoadOrders(value); } } } |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2