<Window x:Class="BandedViewSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dxg:GridControl ItemsSource="{Binding}">
<dxg:GridControl.Bands>
<dxg:GridControlBand Header="0" VisibleIndex="0">
<dxg:GridColumn FieldName="Id" VisibleIndex="0"/>
</dxg:GridControlBand>
<dxg:GridControlBand Header="1" VisibleIndex="1">
<dxg:GridColumn FieldName="Text" VisibleIndex="1"/>
<dxg:GridColumn FieldName="Number" dxg:BandBase.GridRow="1" VisibleIndex="3"/>
</dxg:GridControlBand>
<dxg:GridControlBand Header="2" VisibleIndex="2">
<dxg:GridColumn FieldName="MultiLineText"/>
</dxg:GridControlBand>
</dxg:GridControl.Bands>
<dxg:GridControl.View>
<dxg:TableView AllowChangeColumnParent="True" AllowChangeBandParent="True" />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
namespace BandedViewSample {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
List<TestData> list = new List<TestData>();
for(int i = 0; i < 100; i++)
list.Add(new TestData() { Id = i, Text = "Row" + i, Number = i, MultiLineText = "Row" + i + "Line0" + Environment.NewLine + "Row" + i + "Line1" + Environment.NewLine + "Row" + i + "Line2" });
DataContext = list;
}
}
public class TestData {
public int Id { get; set; }
public string Text { get; set; }
public int Number { get; set; }
public string MultiLineText { get; set; }
}
}
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Windows
Imports System.Windows.Documents
Namespace BandedViewSample
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
Dim list As New List(Of TestData)()
For i As Integer = 0 To 99
list.Add(New TestData() With {.Id = i, .Text = "Row" & i, .Number = i, .MultiLineText = "Row" & i & "Line0" & Environment.NewLine & "Row" & i & "Line1" & Environment.NewLine & "Row" & i & "Line2"})
Next i
DataContext = list
End Sub
End Class
Public Class TestData
Private privateId As Integer
Public Property Id() As Integer
Get
Return privateId
End Get
Set(ByVal value As Integer)
privateId = value
End Set
End Property
Private privateText As String
Public Property Text() As String
Get
Return privateText
End Get
Set(ByVal value As String)
privateText = value
End Set
End Property
Private privateNumber As Integer
Public Property Number() As Integer
Get
Return privateNumber
End Get
Set(ByVal value As Integer)
privateNumber = value
End Set
End Property
Private privateMultiLineText As String
Public Property MultiLineText() As String
Get
Return privateMultiLineText
End Get
Set(ByVal value As String)
privateMultiLineText = value
End Set
End Property
End Class
End Namespace