AV error w/lookup combo on detail grid in Master/Detail config

Comments

19 comments

  • Official comment
    Roy Woll

    Kyle, I don't think I have enough info to reproduce. Can you email us at support a simple project with the problem?  Also can you try dropping in a TwwLookupComboEdit and attaching this a a custom control instead of using the properties.  I recall seeing a case where the auto-created lookup combo will not work but the custom control does.

    Comment actions Permalink
  • kyle

    I will try using a separate TwwLookupComboEdit tomorrow.

    Here is a test project and I think the DDL for all the tables.

    https://app.box.com/s/9f7hvqadd0yva3p830wds09lz1hu62cl

    0
    Comment actions Permalink
  • kyle

    This might be just master/detail issue. I removed all lookup field & controls. Editing in the detail grid raises an exception.

    Still reviewing things.

    0
    Comment actions Permalink
  • kyle

    I figured out the source of the problem. A LookupCombo column in a master/detail relation where the detail grid is in an expander causes the AV error. Dropping a lookup combo and assigning a custom control to the column, as you suggested, works. One condition: The lookup key field must be in the drop down and must be the first column. When the user starts typing, it matches on the key field, not the result field. Not the preferred behavior.

    None of this is needed in the master grid. LookupCombo's work as expected and desired.

    In a related matter, why does the master record disappear when the detail is expanded?

     

    ACORUS expanded:

     

     

    0
    Comment actions Permalink
  • Roy Woll

    Are you using the latest. There was a recent change relating to master/detail that might address your display issue when expanded.

    Version 12.0.5.6 (3/1/2020) - Requires RAD Studio 10.3.2 or 10.3.3

    • TwwDataGrid - Master Detail Grid could have painting problems in some cases with PaintOptions.PaintEfficiency set to BufferRecords. This problem is fixed.

    0
    Comment actions Permalink
  • kyle

    Installed 12.05.6, verified PaintEfficiency set to BufferRecords, and performed a Build. The master record still disappears when child is expanded.

    Any reason why they LookupField must be the first column in the drop down grid in detail grids? No LookupField column or custom control needed in master grid.

    Note: In the sample app I provided, unit3 has an expander setup. Delete it and children to remove the AV error. The other test form, unit1 has an extra expander that can be deleted.

    0
    Comment actions Permalink
  • Roy Woll

    Please note that I am not able to run your project as it does not seem to have any data.  I see you have provided a file to define the table structure, but there is no data.  I need the data to run and debug your project.

    0
    Comment actions Permalink
  • Roy Woll

    I was able to add my own data and I can see the access violation problem now. I am investigating this one now.

    0
    Comment actions Permalink
  • Roy Woll

    I see one problem in your project in that you have wwexpander1 doing nothing and having an embedded grid attached to the same bind source.  I believe this is causing the access violation since it is invisible.  Can you delete wwexpander1 since it seems to be of no use in your project.

    0
    Comment actions Permalink
  • kyle

    Yea. I was experimenting and left some kruft. See my note above about Unit3. There was an unattached expander in unit1 I believe. I cleared all of that out and am still seeing errors:

    1. AV error when using LookupCombo on details.

    2. Master record disappears when child grid expanded.

    Probably obvious, but the purpose of Unit1 & Unit3 is the ease of switching to either form for testing by auto-creating and setting the main form.

    Here's my Unit1 now:

    Unit3 cleaned up:

    0
    Comment actions Permalink
  • Roy Woll

    Please send me the project with the data, or at least the dat. 

    0
    Comment actions Permalink
  • Roy Woll

    I was able to reproduce the lookupcomboedit access violation.  Unfortunately I cannot reproduce the disappearing master record problem. Note, I deleted your wwexpander1 which is not used by your project first.

    0
    Comment actions Permalink
  • kyle

    Clarification on the disappearing master record issue. It's just the first record in the dataset that disappears. Expand the 10th record in master to see child grid, recno 1 disappears.

    Please download the sample project again. It's cleaned up and includes a backup of the SQL database. Restore to Express or Server.

    Good to know on the AV error. It's really the last show stopper. The separate master/detail grid, as seen in unit 3, is working. It was failing because of the leftover child expander & grid. Even those not used in unit 3, setting the combo value in the detail grid tripped the expander grid and created an AV.

    0
    Comment actions Permalink
  • kyle

    Here is the disappearing act. (Hoping the forum software supports GIF.) 

    I wonder if the running environment has something to do with it. Doubtful, but possible.

    OS: Windows Server 2016 desktop sessions via Remote Desktop Windows XP client.

    0
    Comment actions Permalink
  • Roy Woll

    Unfortunately I cannot restore your database. I get the message sql error: The backup set holds a backup of a database other than the existing 'GrowMate' database (Microsoft.SqlServer.SmoExtended)

    0
    Comment actions Permalink
  • kyle

    Okay I updated the project. It has the DDL and data files as insert statements. Foreign keys excluded so it's easy to load.

    0
    Comment actions Permalink
  • Roy Woll

    I have created a test FirePower build addressing all your issues. Can you please try at

    https://drive.google.com/file/d/1OhHAODZJNiO853Fn419EK7GGYY2oQ_8G/view?usp=sharing

    Please let me know your results.

     

     

     

    0
    Comment actions Permalink
  • kyle

    Sorry for the delay. My environment is installed on a terminal server, which has been down. It's backed up. I'm about to install the update. Thanks!

    0
    Comment actions Permalink
  • kyle

    1. FIXED: AV error in child grid when selecting value in a LookupCombo.

    2. FIXED: First record in master grid disappearing when child grid expanded.

    3. FIXED: Invalid cast when adding item to a LookupCombo in a TwwRecordViewPanel.

    A big thank you for getting this addressed quickly!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk