Home Forums WPF controls Xceed DataGrid for WPF Can’t update the data table ItemSource

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23090 |

    Hello.

    I am modifying the resent, new Xceed team’s very nice sample, named DataBinding.
    I am using it to work against a SQL Server database, brought into the modified application as a Dataset of Data Tables.
    I am using the BindToDataGridCollectionView() procedure to bind the datagrid to a data table, named “Donors”, in my Dataset.
    The difference is that originally, Xceed programmers, are binding the datagrid to a data source enclosed in a dll, so it is impossible to see what is going on.
    As I said, I am trying to use the same methodology of binding to a Dataset, only my Dataset is originated in a different way.
    The binding goes just fine. The thing is, that for some reason, updating the underlying Data Table is not working, and after entering data into the insertion row, and pressing Enter, I get the next exception:
    “Object reference not set to an instance of an object.”

    I am displaying the modified procedures that are participating in the data binding methodology:

    Partial Public Class App
    Inherits System.Windows.Application

    Protected Overrides Sub OnStartup(ByVal e As StartupEventArgs)
    XceedDeploymentLicense.SetLicense()

    Dim ds As New HW1DataSet
    m_donors = ds.Tables(“Donors”)

    MyBase.OnStartup(e)
    End Sub

    Private m_donors As DataTable

    Public ReadOnly Property Donors() As DataTable
    Get
    Return m_donors
    End Get
    End Property

    End Class

    Partial Public Class MainPage
    Inherits Page

    Private Sub BindToDataGridCollectionView()
    ‘ With this binding, Adding, removing, and modifying data will work.
    txtDescription.Text = Data.DataGridCollectionViewText

    ‘ Reset the grid to its initial state.
    Me.ResetGrid(True, True)

    ‘ Create an Xceed DataGridCollectionView using the Products DataTable as its source.
    Dim dataGridCollectionView As DataGridCollectionView = New DataGridCollectionView((CType(Application.Current, App)).Donors.DefaultView)

    ‘ Bind the grid to the Xceed DataGridCollectionView.
    grid.ItemsSource = DataGridCollectionView

    End Sub

    End Class

    Imported from legacy forums. Posted by Lior (had 2017 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    We are not able to reproduce the problem you describe. If you could provide us with a simple repro app, that would be appreciated!

    Thank you!

    Imported from legacy forums. Posted by Pascal (had 3126 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.