Ok, here is the code I am using to load my grids. I have two datagrids.
code to load the first grid
--------------------------------------
'clear dataset
objMasterListDa taSet.Clear()
objMasterListDA .FillSchema(obj MasterListDataS et, SchemaType.Sour ce,
"MasterList ")
'fill dataset with info from dataAdapter
objMasterListDA .Fill(objMaster ListDataSet, "MasterList ")
'removed when deleted true dbgrid
'tdbgMasterItem s.DataSource = objMasterListDa taSet
'tdbgMasterItem s.DataMember = "MasterList "
grdMasterItems. DataSource = objMasterListDa taSet
grdMasterItems. DataMember = "MasterList "
' Create new Table Style.
Dim ts As New DataGridTableSt yle
ts.MappingName = "MasterList "
grdMasterItems. TableStyles.Cle ar()
grdMasterItems. TableStyles.Add (ts)
' Assign New Width to DataGrid column.
grdMasterItems. TableStyles("Ma sterList").Grid ColumnStyles("I sle").Width = 50
grdMasterItems. TableStyles("Ma sterList").Grid ColumnStyles("I tem").Width =
160
grdMasterItems. TableStyles("Ma sterList").Grid ColumnStyles("I sle").NullText =
"00"
grdMasterItems. TableStyles("Ma sterList").Grid ColumnStyles("I tem").NullText =
" "
'set master list grid label to total number of records
updateMasterLab el()
code to load the second grid
-------------------------------------------
'clear dataset
objShoppingList DataSet.Clear()
objShoppingList DA.FillSchema(o bjShoppingListD ataSet, SchemaType.Sour ce,
"ShoppingLi st")
'fill dataset with info from dataAdapter
objShoppingList DA.Fill(objShop pingListDataSet , "ShoppingLi st")
grdShoppingList .DataSource = objShoppingList DataSet
grdShoppingList .DataMember = "ShoppingLi st"
' Create new Table Style.
Dim ts As New DataGridTableSt yle
ts.MappingName = "ShoppingLi st"
grdShoppingList .TableStyles.Cl ear()
grdShoppingList .TableStyles.Ad d(ts)
' Assign New Width to DataGrid column.
grdShoppingList .TableStyles("S hoppingList").G ridColumnStyles ("Isle").Wid th =
50
grdShoppingList .TableStyles("S hoppingList").G ridColumnStyles ("Item").Wid th =
160
grdShoppingList .TableStyles("S hoppingList").G ridColumnStyles ("Isle").NullTe x
t = "00"
grdShoppingList .TableStyles("S hoppingList").G ridColumnStyles ("Item").NullTe x
t = " "
grdShoppingList .TableStyles("S hoppingList").A llowSorting = False
'set shopping list grid label to total number of records
updateShoppingL abel()
I appreciate any help
--
Tony
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:br******** ****@ID-208219.news.uni-berlin.de...
* "TM" <no********@not hing.com> scripsit: I have a small application that displays records from an access mdb into
two datagrids and am looking to see if it is possible to speedup the
loadtime somehow.
In my formload I am filling my dataset and binding it to the datagrids.
Is there a better place to get my grids loaded and speed up the program
loadtime ?
Post some code...
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>