Hi,
I have a problem with DataSource Binding a dataSet to the grid
For certain project it takes between 2 or 3 minutes to bind de data to the grid
I Prepare by programmation the data into 2 dataTable that are in a DataSet. this operation is very fast
Once my dataset is ready I bind It into the grid.Everything works fine but for certain project the binding it is to long.
Is there someting I can do to optimise this?
This is some code to explain how I structure my DataTable and Dataset
CreateRootTable() ' Create Column for the rootTable
CreateSubCategoryTable() ' Create Column for the subCategory Table
m_DataSetRoot.Tables.Add(m_tblroot) ' Addind the rootTable into the DataSet
m_DataSetRoot.Tables.Add(m_tblSubCategory) ' Adding the subCategoryTable into the DataSet
Dim rel As DataRelation
m_DataSetRoot.Relations.Add(rel)
m_DataSetRoot.AcceptChanges()
Thanks in advance
I finally find the problem.
I did what you suggest and the problem was in the myGrid_InitializeRow event
I was calling a function that took a lot of time because this function was calling a lot of time
So I place the call of this function somewhere else and now everything is ok.
Thanks for your support it is appreciated
Have a nice day :)
There's no reason why the grid should ever take 3 minutes to bind. But in order to figure out how to fix this, we would need to know why it's taking so long.
The first thing I would do is set the Visual Studio IDE to break on all run-time exceptions and see if any exceptions are occurring. Exceptions tend to slow down program execution quite a lot, even if the exception is handled.
If that does not help, the next thing I would do is check any event handlers that are hooked up to the grid and try disconnecting them or commenting out the code to see if something in one of the grid events is causing a problem.
Also... is the grid bound before or after you call the code listed here? It would probably be best for you to create the data source, add all the tables and relations, accept changes, and THEN bind it to the grid. Otherwise, the grid will get notifications every time you add a table or a relation and it will be resetting the data structure and re-loading many times over.
If none of that helps, then I would recommend that you try to duplicate the problem in a small sample project and Submit an incident to Infragistics Developer Support so they can determine why it's so slow.