in
Forums
Blogs
DevExpress.com
Client Center
Support Center
DevExpress Channel

LookupEdit Popup reappearing

Last post 7/17/2007 8:07 AM by Holger Persch [DX-Squad]. 15 replies.
Sort Posts: Previous Next
  • 7/11/2007 10:42 AM

    LookupEdit Popup reappearing

    Hi,

    I have a strange problem using a LookupEdit as column editor in one of my GridControl columns.
    First, I load a data record (ie article list). This record also contains a list of other data records (articles). The list is used as data source for my grid.
    In the LookupEdit I can select between different types. After selecting a type by clicking on it, the list closes as expected.

    Now, if I save the changes and load the next article list (containing no articles, thus the grid is empty), the popup suddenly shows up again. It is even possible to select a value from it - but as there is no instance of article it doesn't do anything.

    I tried catching the .Popup and .Close Event on the LookupEdit, but I received each event only once - as it is supposed to be. Is there maybe a way to access the popup handle, and dispose it manually?

    Thanks for any help!

  • 7/12/2007 4:11 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Jürgen,
     

    Jürgen Piazzi:
    ...and load the next article list (containing no articles, thus the grid is empty)...
    I think you first have to add a new row to the grid (datasource) so the PopupEdit can save it's edit value to it.

    Regards,
    Holger

    Holger Persch [DX-Squad]
  • 7/12/2007 9:09 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Holger,

    Thank you for your reply, but you misunderstood my problem. The thing is that I don't want to save any information - I don't even want the popup to appear after loading a new data record.
    - I select a data record containing data rows to populate the grid
    - click the dropdown button of my repository item lookupedit in one row => *the dropdown list is visibly open*
    - select a different value by chosing it from the dropdown list (leftclick, duh) => *the dropdown list is visibly closed*
    - load a different data record containing no rows for the grid => *the dropdown list is visibly open - although there is NO row available where I could even click to open the dropdown list!*

    I've put together some screenshots to show exactly what I mean:

    http://www.geocities.com/q_chuck/lookupedit.jpg

    Any ideas?

  • 7/12/2007 10:07 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Jürgen,

    Sorry, but I'm not able to reproduce the behavior you described.

    Please have a look into the sample project attached to this post.

    Regards,
    Holger

    Holger Persch [DX-Squad]
  • 7/13/2007 4:21 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Holger,

    I tried your project (using 7.1 libraries) and - as rather expected - it worked. Then I compared the two projects, but I couldn't find any real difference... settings are all the same, only that all my other columns are readonly = true and allowinput = false. Yet my problem remains... Is it possible to access the window handle of the dropdown somehow, so I could deal with it manually?

    Thanks again for your help

  • 7/13/2007 4:51 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Jürgen,

    IMHO it's not a appropriate solution to access the popup window by it's handle and besides that it's (AFAIK ) not possible to access the PopupForm from outside the PopupEdit.

    If you would post your project here then I could have a look into it. Maybe I'm able to locate the problem.

    Regards,
    Holger

    Holger Persch [DX-Squad]
  • 7/13/2007 8:13 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Holger,

    I am not sure if I can send you the project "as is", have to check that with my superiors first. I can try to edit the project and size it down to the problematic part, but that might take a while.

  • 7/15/2007 8:15 PM In reply to

    Re: LookupEdit Popup reappearing

    Hey,

     i had the same problem. it is very frustrating. I tried for weeks to find a solution but nothing. the .closepopup is no good as the pop up still flashes open for a second and looks pretty bad.

    i used a combo box insted, it was a lot of effort to bind it but i cant handel that crazy pop up anymore!

     

    chris
     

  • 7/16/2007 6:13 AM In reply to

    Re: LookupEdit Popup reappearing

    Hi,

    (Still trying to figure out how to attach a file here... will be updated soon!)
    I've rebuilt the project over the weekend and reduced it mainly to the problematic part.
    A word of warning though: functionality has suffered a bit, so don't expect a fully working program.

    Run the app, open menu Master Data -> Contract
    Type 1 in Contract ID and press enter to load the contract
    Now you're in "view mode" - fields are all locked except for the Contract ID
    To switch to "edit mode", click the Edit Icon (the one with the pen on it)
    Now open the dropdown in the column "Group Name" - you can select a different value, but don't bother it won't be saved.
    If you switch back to "view mode" (the icon with the magnifying glass on it), a prompt will ask you to save or not - click No, otherwise you'll get an exception.
    But what you will see then is that the popup reappears - although now the popup cannot even be opened, as in view mode the column is locked.
    If you don't close the popup and enter 2 as Contract ID, the contract will load and still the popup will remain open.

    I hope it is clear how to reproduce the problem, if not please let me know.

  • 7/16/2007 6:39 AM In reply to

    Re: LookupEdit Popup reappearing

    Hello Jürgen,

    Jürgen Piazzi:
    Still trying to figure out how to attach a file here
    Switch to the Options tab page and click the Add/Update button to add attachments to your posts.

    Holger

    Holger Persch [DX-Squad]
  • 7/16/2007 9:05 AM In reply to

    Re: LookupEdit Popup reappearing

    Didn't work, the file is still too big. I've put it on RapidShare instead, please tell me when you have the file so I can delete it from there again.

     http://rapidshare.com/files/43223669/project.rar

  • 7/16/2007 10:08 AM In reply to

    Re: LookupEdit Popup reappearing

    I have downloaded the file - can be deleted now.

    I will have a look into the project ASAP.

    Holger Persch [DX-Squad]
  • 7/16/2007 11:32 AM In reply to

    Re: LookupEdit Popup reappearing

    Hi again,

    I have now encountered a similar issue using a normal lookupedit, but this time I also got the popup event.
    On Init, I add a datasource to the lookupedit.
    Now before I load the data record and put the values into my fields, I reset them, using .ResetText() for all LookupEdits (please have a look at the function "ResetForm", it is the same in the file I have sent you).
    Calling this ResetText function for the LookupEdit causes the popup event to trigger - which it shouldn't. Here is the stack:

     MultiVM.exe!MultiVM.frmAgreement.lookUpGroupName_Popup(object sender = {DevExpress.XtraEditors.LookUpEdit}, System.EventArgs e = {System.EventArgs}) Zeile 1212 C#
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.Repository.RepositoryItemPopupBase.RaisePopup(System.EventArgs e) + 0x56 Bytes 
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.PopupBaseEdit.OnPopupShown() + 0x14 Bytes 
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.PopupBaseEdit.DoShowPopup() + 0x22f Bytes 
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.LookUpEdit.DoShowPopup() + 0x44 Bytes 
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.PopupBaseEdit.ShowPopup() + 0x5c Bytes 
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.LookUpEdit.ProcessText(DevExpress.XtraEditors.Controls.KeyPressHelper helper = {DevExpress.XtraEditors.Controls.KeyPressHelper}, bool canImmediatePopup) + 0x24e Bytes 
      DevExpress.XtraEditors.v7.1.dll!DevExpress.XtraEditors.LookUpEdit.Text.set(string value) + 0x65 Bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Control.ResetText() + 0x1d Bytes 
      MultiVM.exe!MultiVM.frmAgreement.ResetForm(System.Windows.Forms.Control parent = {DevExpress.XtraTab.XtraTabPage, BorderStyle: System.Windows.Forms.BorderStyle.None}, System.Windows.Forms.Control doNotReset = {DevExpress.XtraEditors.TextEdit}) Zeile 235 + 0x32 Bytes C#
      MultiVM.exe!MultiVM.frmAgreement.ResetForm(System.Windows.Forms.Control parent = {DevExpress.XtraTab.XtraTabControl}, System.Windows.Forms.Control doNotReset = {DevExpress.XtraEditors.TextEdit}) Zeile 252 + 0xe Bytes C#
      MultiVM.exe!MultiVM.frmAgreement.ResetForm(System.Windows.Forms.Control parent = {MultiVM.frmAgreement, Text: Agreements}, System.Windows.Forms.Control doNotReset = {DevExpress.XtraEditors.TextEdit}) Zeile 252 + 0xe Bytes C#

    Maybe this gives you another hint as to what it might be?

    [Edit]
    Strange though: this does not happen when I use a LookUpEdit without a dropdown button - for instance, lookupEditCountry in my sample project is such a case. Or it could be, because the control is entirely disabled?

  • 7/17/2007 5:02 AM In reply to

    Re: LookupEdit Popup reappearing

    Answer

    Hello Jürgen,

    I was able to reproduce and fix the problem you mentioned.
     

    Jürgen Piazzi:
    Now before I load the data record and put the values into my fields, I reset them, using .ResetText() for all LookupEdits (please have a look at the function "ResetForm", it is the same in the file I have sent you).
    You should rather set the LookupEdit's EditValue to null than calling the ResetText method to reset the control - this applies to all BaseEdit derived DX editor controls.

    .
    .
    .
    else if (ctrControl.GetType() == typeof(LookUpEdit))
    {
        // Check to see if the control is a DropDown List
        // If it is then set it's SelectedIndex to 0
        //((LookUpEdit)(ctrControl)).ResetText();
        ((LookUpEdit)(ctrControl)).EditValue = null;
    }
    .
    .
    .

    Hope this helps,
    Holger

    Holger Persch [DX-Squad]
  • 7/17/2007 7:23 AM In reply to

    Re: LookupEdit Popup reappearing

    Hi Holger,

    Thanks a lot! Now it works correctly. Just for the sake of completeness - why can't I use ResetText()? The description says it resets the text property to its default value. That doesn't sound awfully wrong to me, nor like an explanation why the popup opens? What exactly is the deal between .Text and .EditValue - they look rather the same to me, assigning a value to the .Text property seems to do the same as assigning it to the .EditValue property.

    Regards

    Jürgen

Copyright © 1998-2010 Developer Express Inc.
ALL RIGHTS RESERVED