作成日: 2020/06/29 最終更新日: 2021/07/28
文書種別
不具合
状況
修正済み
詳細
データを持たない空のコレクションで作成したCollectionViewをGcSpreadGridのItemsSourceプロパティに連結すると、CanUserAddRowsプロパティにより新規行の設定を有効にしたとしても、実行時に新規行が表示されません。
回避方法
Service Pack 5(v2.0.2021.0728)で修正済みです。
Service Pack 5(v2.0.2021.0726)より前のバージョンでは次の回避方法が有効です。
IEnumerableインターフェースを実装した新しいコレクションビューを作成して連結します。
◎サンプルコード(VB)
◎サンプルコード(VB)
Imports GrapeCity.Windows.SpreadGrid Class MainWindow Public Property MySource As ICollectionView Dim vs As New ProductCollection Private Sub UI_Loaded(sender As Object, e As RoutedEventArgs) MySource = New ListCollectionView(Of Product)(vs) spGrid.DataContext = Me End Sub End Class Public Class ListCollectionView(Of T) Inherits ListCollectionView Implements IEnumerable(Of T) Public Sub New(list As IList(Of T)) MyBase.New(list) End Sub Private Iterator Function IEnumerable_GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator For Each item In Me Yield item Next End Function End Class Public Class Product Implements INotifyPropertyChanged Private m_id As String Public Property ID() As String Get Return m_id End Get Set(value As String) m_id = value NotifyPropertyChanged() End Set End Property Private Sub NotifyPropertyChanged( Optional name As String = Nothing) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(name)) End Sub Private m_name As String Public Property Name() As String Get Return m_name End Get Set(value As String) m_name = value NotifyPropertyChanged() End Set End Property Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged End Class Public Class ProductCollection Inherits ObservableCollection(Of Product) End Class
旧文書番号
85762