zaggle
2014-02-20T01:53:05Z
I am trying to set the row color of alternate rows. In my case some rows should be the same as the previous row depending on a certain criteria, so the odd / even rowbackcolor will not do.

I tried the RowDynamicFormatting, but of course, it's dynamic and is constantly changing on mousemove or click. Is there a way to set a RowColor, so that when the grid loads or refreshes it has a specific rowcolor arrangement. Something like.

For lRow if Column value = to previous column value then current rowbackcolor = previous rowbackcolor
else current rowbackcolor = alternate rowbackcolor

As I said I have done this with RowDynamicFormatting (see attached image) but need to create the same result without the dynamicness. Easy to do if there is a way to access the row back color, but I can't seem to find it.


zaggle attached the following image(s):
Igor/10Tec
2014-02-20T06:43:28Z
If we get you right, you can simply use the BackColorOddRows/BackColorEvenRows properties for that.
zaggle
2014-02-20T07:01:46Z
Thanks...

but if you look at the image I frequently have two rows for the same client that I want to retain the pattern for.

But no worries, I gave up using it after spending two days with it I ran into an error twice that made me think it was too risky. It kills the database so that it will not open at all, it throws a Runtime 97 error and then hangs the application I can only close it down by killing the process. It does not fix the issue on open, every time I go into design mode with the same form it runs the error.
The first time I thought it was just a random error and applied the same changes to a backup db, after a day working on it the same error occurred. I have had to scrap my second database. When trying to resolve it the first time, I came across this thread, which is exactly the same error I'm getting.

It's a good control in so many ways, but his error is too risky to release it to a client.

Regards,
zaggle
2014-02-20T07:04:55Z
here's the link to the thread I left out of the above post
http://www.know-access.c...t-in-this-control-m.html 
Oliver
2014-02-26T15:26:26Z
First, the "Runtime Error 97" is a MS-Access Problem. A workaround that will save your work without a backup DB is here:
http://10tec.com/Forum/y...cess-2010--Error-97.aspx 

Second, I don't understand the problem you have with the RowDynamicFormatting-Event. It works fine for the same purpose in my project and even the CellDynamicFormatting-Event (that gets called even more often) works pretty well for setting some colors. Yes, under Access, both are called a few more times than necessary, but that has not been a problem so far.

You can of course do it after populating the grid in a
For lRow = 1 To .RowCount
loop, but then you have to set each column's .CellBackColor individually. There is no such thing as a .RowBackColor.
You can save 50% of the time by only setting the .CellBackColors when the desired color is not the default-color and skipping the others.

Regards,
Oliver