AlternatingRowStyle does not work with TrueDBGrid 2.0

Posted by: ismayorgav on 5 August 2022, 9:54 am EST

    • Post Options:
    • Link

    Posted 5 August 2022, 9:54 am EST - Updated 3 October 2022, 1:16 pm EST

    Hi, Good Day, I have a TrueDBDGrid 2.0 and when I set AlternatingRowStyle to True it doesn’t apply the color of even or odd cells (evenRowStyle-OddRowStyle), I know it’s Aqua by default for EvenRowsStyle but it doesn’t, it only does if I set the FetchStyle property to True, TRUE? Any recommendation?

    Note: It also doesn’t do it from layout or properties, that’s why I’m trying to do it by code.

  • Posted 7 August 2022, 6:30 pm EST

    Hi,

    We tested the issue with the C1TrueDBGrid version 2.0.20213.532 as well as the latest version but we could not see the issue at our end. Kindly refer to the attached sample showing the behavior at our end. Could you please provide a small sample or update the attached sample to replicate the issue, so we can investigate further?

    Also, please let us know the exact version of the C1TrueDBGrid you are using in your application.

    TdbgSample.zip

    Thanks, and Kind Regards,

    Kartik

  • Posted 8 August 2022, 7:55 am EST

    Ok, thanks you so much.

    How does it affect me to use the FetchRowStyles Property in True to handle these colors? It should be clarified that by code I handle the format of cells and columns with a general method.

  • Posted 8 August 2022, 6:15 pm EST

    Hi,

    To handle the alternate row colors, the FetchRowStyles property does not need to be True. The FetchRowStyles property is already False by default and that is why we did not set it to False explicitly in our sample.

    If you observe a different behavior in your application, please provide a small sample or update the attached sample showing your implementation and the properties you are using, so we can investigate further and assist you in the best way possible.

    Also, we could not clearly understand your line

    “It should be clarified that by code I handle the format of cells and columns with a general method”

    Could you please provide a little more detail on what kind of implementation/requirement you need, so we can assist you accordingly?

    Just for your information, the .NET 2.0 version of the C1TrueDBGrid you are using is very old and is already out of support (meaning that it will not receive any new feature updates or bug fixes). That is why, we suggest you update to the latest version of C1TrueDBGrid (2022v2 release of .NET FW 4.8 or .NET 6), to receive regular feature updates and bug fixes.

    Thanks, and Best Regards,

    Kartik

  • Posted 9 August 2022, 1:23 am EST - Updated 3 October 2022, 1:16 pm EST

  • Posted 9 August 2022, 10:51 pm EST

    Hi,

    Since you did not provide a sample, we were not able to completely debug your application, but we tried to copy all the relevant code from your screenshots into a sample.

    As per our understanding, we found a piece of code where you are trying to apply styles over the DisplayColumn and that might be the code causing the issue, as applying Styles on columns will always take precedence over the Odd/Even Row styles. Kindly refer to the attached sample in which we have commented out the code we are talking about.

    We suggest that you remove/rewrite this code accordingly and see if you still face the issue. If the issue persists, it would be really helpful if you provide a small sample or update the attached sample to show the exact issue along with the implementation you have done.

    Attachment: TdbgSample_updated.zip

    Also, for the upcoming responses, if you want to share multiple screenshots on the Forum posts, we request you to please archive them in a zip file instead of attaching them all directly, to maintain the readability.

    Thanks, and Kind Regards,

    Kartik

  • Posted 11 August 2022, 3:29 am EST

    Hello. I attach an example project as it is being used in the original project, the strange thing is that the rows are painted black and the alternatingRows is not applied

    Something to take into account?

    Note: we encapsulate the TrueDBGrid in a component called UnoEETrueDBGridVb6 in order to create or manage some properties.

    Thank you so much.

  • Posted 11 August 2022, 3:36 am EST

    Attachment: TdbgSample.zip

  • Posted 11 August 2022, 7:17 pm EST

    Hello Ivan,

    The sample that you have attached is throwing the attached error at our end and looking for UnoEEGenral dll so kindly share all the custom DLLs that you are using so that we can compile and run the project at our end.

    Also if possible can you please test it without custom DLLs and let us know whether you face the same issue when using the C1TrueDBGrid dll directly?

    Regards,

    Prabhat Sharma.

  • Posted 11 August 2022, 7:17 pm EST - Updated 3 October 2022, 1:16 pm EST

  • Posted 12 August 2022, 1:41 am EST

    Hello, good morning, I found the error and it happens that when a truedbgrid is copied from vb6 to net, the xml that brings the TRUEDBGRID is passed in the .res file, the styles of the columns (DisplayColumn) pass with a property BackColor: Window and when create TRUEDBGRID in .Net, this style is empty. Example of style in Vb6----> “Style17{ForeColor:Black; BackColor:Window}”, in .Net it is like this ---->" Style17 {}", the Backcolor property is eliminated in the xml of the styles that are applied to the column and now it allows me to use AlterningRows.

    Thank you very much for your attention.

  • Posted 15 August 2022, 8:06 pm EST

    Hello,

    Thanks for your valuable comments. We hope that the issue has been resolved at your end. In case you need any other help from our side, please feel free to ask.

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels