G
GraemeR
Hi, how can I set a datagrid control to display the new record row? the code
I'm using crashes the .Net Compact Framework. (Also, the new record row is
automatically displayed in the windows datagrid control)
This is how I'm binding the data to my grid - records are displayed (though
I can't edit them yet)
' Module level variables
Private mDataAdapter As SqlServerCe.SqlCeDataAdapter
Private mDataTable As DataTable
mDataTable = New System.Data.DataTable("MyTable")
mDataAdapter.Fill(mDataTable)
grdDataGrid.DataSource = mDataTable
I've tried:
Private mBindingManagerBase As BindingManagerBase
mBindingManagerBase = grdDataGrid.BindingContext(mDataTable)
mBindingManagerBase.AddNew()
but it crashes the .Net framework.
As does:
Private mCurrentcyManager As CurrencyManager
mCurrentcyManager = CType(grdDataGrid.BindingContext(mDataTable),
CurrencyManager)
mCurrentcyManager.AddNew()
Thanks, Graeme.
I'm using crashes the .Net Compact Framework. (Also, the new record row is
automatically displayed in the windows datagrid control)
This is how I'm binding the data to my grid - records are displayed (though
I can't edit them yet)
' Module level variables
Private mDataAdapter As SqlServerCe.SqlCeDataAdapter
Private mDataTable As DataTable
mDataTable = New System.Data.DataTable("MyTable")
mDataAdapter.Fill(mDataTable)
grdDataGrid.DataSource = mDataTable
I've tried:
Private mBindingManagerBase As BindingManagerBase
mBindingManagerBase = grdDataGrid.BindingContext(mDataTable)
mBindingManagerBase.AddNew()
but it crashes the .Net framework.
As does:
Private mCurrentcyManager As CurrencyManager
mCurrentcyManager = CType(grdDataGrid.BindingContext(mDataTable),
CurrencyManager)
mCurrentcyManager.AddNew()
Thanks, Graeme.