G
Guest
I have a grid that I use to display 4 or 5 different tables with different number of columns. I read some where that you cannot bind a different data set to a grid once you bind one data set to it. I am programatically filling the datagrid with a dataset that is being built on the fly. I am using VFP databases and codebase as well, so I have found no easier way to do this. At any rate when I finish viewing a database and try to clear out the grid, it seems like I am then getting the big red X. Is there something I am doing incorrectly? Here is a code snippet..
BrowseDataSet.Tables.Clear(
BrowseDataSet.Clear(
BrowseDataSet.Dispose(
BrowseTable.BeginLoadData(
BrowseTable.Clear(
' Destroy the columns in the table - I was doing this to destroy column by column but kept getting problems with
' trying to remove some column
' browsearr is just an array set up where the firs member Browsearr(0) is the number of columns in the tabl
' Members 1, 3, 5, 7 are the names of the columsn, 2,4,6,8, and so on are pointers to the data in my CODEBASE structures
'For ICol = 0 To piNumCols -
' ' Get the type of this fiel
' pcFieldName = BrowseArr(ICol * 2 + 1
' Tr
' BrowseTable.Columns.Remove(BrowseTable.Columns(pcFieldName)
' Catc
' End Tr
'Next ICo
'Do While BrowseTable.Columns.Count >
' Tr
' BrowseTable.Columns.Remove(BrowseTable.Columns(BrowseTable.Columns.Count - 1)
' Catc
' ' Do nothing
' 'BrowseTable.Clear(
' End Tr
'Loo
BrowseTable.EndLoadData(
' i THINK THIS IS WHERE THE BIG RED x COMES FROM.....
Tr
o.grdData.Enabled = Fals
o.grdData.Visible = Fals
Catc
End Tr
BrowseDataSet.Tables.Clear(
BrowseDataSet.Clear(
BrowseDataSet.Dispose(
BrowseTable.BeginLoadData(
BrowseTable.Clear(
' Destroy the columns in the table - I was doing this to destroy column by column but kept getting problems with
' trying to remove some column
' browsearr is just an array set up where the firs member Browsearr(0) is the number of columns in the tabl
' Members 1, 3, 5, 7 are the names of the columsn, 2,4,6,8, and so on are pointers to the data in my CODEBASE structures
'For ICol = 0 To piNumCols -
' ' Get the type of this fiel
' pcFieldName = BrowseArr(ICol * 2 + 1
' Tr
' BrowseTable.Columns.Remove(BrowseTable.Columns(pcFieldName)
' Catc
' End Tr
'Next ICo
'Do While BrowseTable.Columns.Count >
' Tr
' BrowseTable.Columns.Remove(BrowseTable.Columns(BrowseTable.Columns.Count - 1)
' Catc
' ' Do nothing
' 'BrowseTable.Clear(
' End Tr
'Loo
BrowseTable.EndLoadData(
' i THINK THIS IS WHERE THE BIG RED x COMES FROM.....
Tr
o.grdData.Enabled = Fals
o.grdData.Visible = Fals
Catc
End Tr