Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
675
DataSource Binding is to long
posted

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

Private Sub CreateGridStructure()

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

' Create the relation between the 2 Datatablerel = New DataRelation(RELATION_NAME_SUB_CATEGORY, m_DataSetRoot.Tables("Root").Columns(COL_NAME_PECLEUNIK_PHASE_CATEGORY), m_DataSetRoot.Tables("SubCategory").Columns(COL_NAME_PECLEUNIK_PHASE_CATEGORY), False)

m_DataSetRoot.Relations.Add(rel)

m_DataSetRoot.AcceptChanges()

End Sub

 Thanks in advance

 

 

 

 

 

Parents
  • 469350
    Offline posted

    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.  

Reply Children
No Data