Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP Error when AllowDeletions is enabled

I have a very simple edit table that had previously had the AllowDeletions property set to 0. The user wanted the facility to delete lines from the edit table so I simply set the property to 1. When I tested it, I get the srpcontrols4020 error window (which tells me pretty much nothing) but the item does delete. I'm pretty sure we're running the most recent version of the SRP Controls, so how do I get rid of the error window?

Comments

  • Yes, it does appear that you are at the latest version. I don't know exactly what error window you are seeing (a screenshot might be helpful), but I think I have an idea as to what it looks like.

    As to how to get rid of the error window, I am not sure yet. I don't think this is related to the AllowDeletions property because that property is used all the time in our applications. However, there is something you can do that will help isolate the problem. Instead of setting the AllowDeletions property to 1, just rem out the code that sets this property. It defaults to 1 so you do not need to set it. I want to see if accepting the default will avoid the problem. If it does, then it seems that setting the property introduces an unexpected error.
  • OK. I tried remming (sp?) out the code line, but I still got the error. As you may remember, whoever created many of these windows used a record in the OLE_SETTINGS file along with a generic SETUP_OLE routine to enable/disable properties. That record looks like (sort of - the VM delimiter didn't translate very well):

    Dimension 1
    RowsToRecords 1
    BorderType XP
    SelectionStyle @VM:S L=90:@FM:@FM:@FM:@FM:0:@FM:0
    SuppressMouseMoveEvent 1
    QuickTabOut 1
    TitleList County/Parrish Name
    NewRowCount 1
    WorkspaceBkColor Window
    ScrollBarsVisible 0:@FM:0

    HeaderColors[All;All] @FM:%Gradient%
    HeaderColumn[1] @FM:0

    AllowInserts 0
    *AllowDeletions 1
    DataColumn[1] 200

    and I am attaching a screen shot of the error window.
  • Yep...that's a pretty useless error window. :) That does come up from time to time when the control encounters an unexpected error condition.

    There is no denying you are encountering an error. The question is "what is causing it?". I think we will have to try and duplicate this on our end. It will probably be easiest to do this with your from. I believe I still have a current copy of your application. Can you tell me what form this is?
  • The form is NDW_COUNTIES. The reason I got started on this was that the NewRowCount was set to 0 in the OLE_SETTINGS record so you couldn't add or delete Counties. So, before you test, you need to set that property to 1 in the record OLE_SETTINGS**NDW_COUNTIES.EDT_COUNTIES. I don't know if this has some effect on the AllowDeletions property, though I can't imagine why it would.
  • Very good. We'll get back to you shortly.
  • My apologies for the delay in getting back to you. I thought I would have more time to look into this before I left for vacation last weekend. However, I come bearing good news and even better news.

    The good news is that I am convinced the AllowDeletions property is unrelated to the issue. I think you only discovered the bug after you updated this property and made a correlation. I was able to duplicate the bug out of the box. All I had to do was click in the SRP EditTable a couple of times and boom...error message. Through some trial-and-error with the other properties being set, I narrowed this down to the DataColumn[1] property. The setup record indicates a column width of 200. However, the control on the form is only 192 pixels wide. While that should not cause the error message, in your case I assume you really do not want a column to be wider than the control. So, you can quickly work around this by changing the 200 value to 192 or just set the column to be auto-sized width (thus, replace 200 with @FM:@FM:@FM:1).

    The even better news is that we fixed this bug in the latest pre-release control (v4.0.4 RC1). You can download it from this link: SRPControls.ocx.

    Even if you download the pre-release control, I still recommend updating your setting to make the column auto-sized width.
Sign In or Register to comment.