in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Some questions about using lookupedit's on an xtragrid in advbandedview

Last post 10/27/2008 12:19 PM by Victor Sergienko. 4 replies.
Page 1 of 1 (5 items)
Sort Posts:
Previous Next
  • 7/10/2007 4:43 PM

    Tongue Tied [:S] Some questions about using lookupedit's on an xtragrid in advbandedview

    Hello there, i have several questions about the "right" way to do some things with xtragrid.

     Basically, im managing all my data logics in a separate class on my application, and that class is running on a separate thread, because this application going to connect to a remote server (internet), and by running the db queries, updates, etc, the UI wont "freeze".

    The problem is, in one of my views im using 2 lookupedit controls for 2 columns, those lookup edit controls take their values from 2 different tables on my dataset, AND im filling the dataset tables manually at runtime.

    For some reason, everything works perfect, the grid loads the data, etc, BUT the lookupedit controls refuse to display ANY data at all.

    I would like to mention that if i bind an standard datagridview control to the SAME datatable that im using for the lookupedit controls, the data is there and i can see/edit it.

    I will paste some parts of my code for better understanding.

    The following method is inside a separate class and initializes several dataTable objects with data from a mysql DB, please note that this method is called in a separate thread using a BackgroundWorker component.

        Public Sub inicializar()
            Dim daVideos As New MySqlDataAdapter("SELECT * FROM videos", mySQLConnection)
            Dim daTipos As New MySqlDataAdapter("SELECT * FROM tipos", mySQLConnection)
            Dim daFormatos As New MySqlDataAdapter("SELECT * FROM formatos", mySQLConnection)
            Dim daTomas As New MySqlDataAdapter("SELECT * FROM tomas", mySQLConnection)
            RaiseEvent action("Procesando Videos")
            videosTable.TableName = "videos"
            daVideos.Fill(Me.videosTable)
            RaiseEvent action("Procesando Tipos")
            tiposTable.TableName = "tipos"
            daTipos.Fill(tiposTable)
            RaiseEvent action("Procesando Formatos")
            formatosTable.TableName = "formatos"
            daFormatos.Fill(formatosTable)
            RaiseEvent action("Procesando Tomas")
            tomasTable.TableName = "tomas"
            daTomas.Fill(tomasTable)
            RaiseEvent initComplete()
            RaiseEvent action("Inicialización Completa")
        End Sub

    After this method finishes, i have several dataTables filled with data that i merge to my main dataset:

        Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
            datasetChilds.Merge(sqlengine.formatosTable)
            DataSet1.Merge(sqlengine.tomasTable)
            DataSet1.Merge(sqlengine.formatosTable)
            DataSet1.Merge(sqlengine.tiposTable)
            DataSet1.Merge(sqlengine.videosTable)
            busyDialog.Close()
        End Sub

    The lookupedit controls in question are binded to datasetChilds.formatosTable and DataSet1.tiposTable ....

    If i bind any other control (like a datagridview) to the same datasets, everything just works, but lookupedit controls from DevExpress are showing just the columns, but no data at all :/

    Btw, the reason im using dataTables as "intermediates" to transfer the data back to the main dataset is because you cant fill a dataset from a different thread than the one it was created.

    Any suggerences will be welcome.

    Im using the trial version of DXperience 7.1.4 on VisualBasic Express 2005.

    Thanks in advance, Diego.

     

    Take Care, Diego Massanti.
  • 7/10/2007 5:27 PM In reply to

    Re: Some questions about using lookupedit's on an xtragrid in advbandedview

     How are you assigning the DataSource property to the LookupEdit control? Are you setting a DisplayMember and ValueMember property?

    http://www.logisticdynamics.com
  • 7/10/2007 6:12 PM In reply to

    Re: Some questions about using lookupedit's on an xtragrid in advbandedview

    The datasource, the displaymember and valuemember properties are set at design time, because as i said, i have the main dataset at design time (im just merging later the temporal dataTables into it).

    The weird thing is that the data is actually there, i checked with both the dataTable explorer in the debugger and also by using a datagridview binded to the same datasource and datamember, and the data displays just perfect ....

    I dont know what any other thing i could try :/

    Take Care, Diego Massanti.
  • 7/11/2007 12:29 AM In reply to

    Re: I think it is a bug...

    Ok, after a lot of investigation i think this is a bug, the same datasets and tables work perfect with microsoft's datagridview component, and the lookups fill perfect, etc.

    With the xtragrid, the lookupedit controls placed on a gridview of any kind wont show the actual data (but the columns are displayed without a problem) if the datasets and tables are filled by hand from a background thread.

    I dont know if people from DevExpress read this forum, but i can provide code and DB schema to reproduce this issue if needed.

    Take Care, Diego Massanti.
  • 10/27/2008 12:19 PM In reply to

    Re: I think it is a bug...

    You could try to inherit and override a PopupForm of the LookupEdit, and call it's LayoutChanged().

    This helped me to force a refresh of rows retrieved in background.

Page 1 of 1 (5 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED