on 04-19-2006 8:21 PM
Hi,
i have a code that adds a DataTable to a form and then links this to a Grid.
this works fine.
the problem is even when i change the DataTable after it is created, the Grid only get cleard and shows the correct headers but the data it self is not shown.
any idea regarding the reson?
my code is:
'Create the DT and link to Grid
form.DataSources.DataTables.Add("DataTable")
form.DataSources.DataTables.Item("DataTable").ExecuteQuery("select * from OITM")
oGrid.DataTable = form.DataSources.DataTables.Item("DataTable")
'change the DataTable or just use the same one
form.DataSources.DataTables.Item("DataTable").ExecuteQuery("select * from OITM")
'which clears the Grid instead of updating it
Thanks
MM
can you try, for the second update
oGrid.DataTable.ExecuteQuery("select * from OITM")
Message was edited by: Sébastien Danober
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastien
thanks for your help.
i'm also using the sample 19
like this:
oGrid = oItem.Specific
oForm.DataSources.DataTables.Add("MyDataTable")
oForm.DataSources.DataTables.Item(0).ExecuteQuery("select CardCode, CardName, DocDate, DocNum, DocTotal, DocStatus from OINV")
oGrid.DataTable = oForm.DataSources.DataTables.Item("MyDataTable")
'this is the line i added for updating the grid
oGrid.DataTable.ExecuteQuery("select * from OITM")
and the grid just being cleared.
btw i'm using SAP 2005a SP1 PL2
Hi,
The problem has been reported to support.
In the meanwhile a workaround has been proposed:
oForm.Freeze(True)
oGrid.DataTable = Nothing 'detach Grid and DataTable
oForm.DataSources.DataTables.Item("MyDataTable").ExecuteQuery(...)
oGrid.CollapseLevel = 0
oForm.Freeze(False)
Hope it helps
Trinidad.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.