Jump to content


Jordan

Member Since 13 Jul 2009
Offline Last Active Mar 08 2010 09:40 PM
-----

Posts I've Made

In Topic: OnCellColoring problem

18 July 2009 - 12:35 AM

QUOTE (Jordan @ Jul 17 2009, 07:31 PM) <{POST_SNAPBACK}>
I have started using the OnCellColoring event, and for one of my applications, the event is triggered with a Row value that is equal to RowCount, causing an index out of bounds exception when I use that value. I had to place a test for this condition in the event code:

CODE
  if ARow >= TheGrid.RowCount then
    exit;
... actual code to set colors


The safety check seems to work fine, but I have to remember to include it in all my event handlers.

Has this problem been reported before?


I found this earlier post that seems to answer my question:

http://www.bergsoft....=oncellcoloring

Is there a way to suppress the drawing of inactive rows. I would like to have grid lines, but only for the active rows, and so far, I haven't been able to do that.

In Topic: ScrollBars visible?

18 July 2009 - 12:25 AM

The NextGrid.InnerWidth property will give you the number of pixels available. When I tried it, it seemed to take into account both the vertical scroll bar and the indicator column.

In Topic: Problem with LoadFromRegistry

17 July 2009 - 04:32 PM

QUOTE (Boki (Berg) @ Jul 16 2009, 05:37 PM) <{POST_SNAPBACK}>
Hello Jordan,

I think that I have solve it. I will test it a little bit more and then send you a fix.

Best regards


Excellent! I am looking forward to the solution.

Thank you!!

In Topic: LoadFromRegistry suggestion

15 July 2009 - 03:20 AM

QUOTE (Boki (Berg) @ Jul 14 2009, 05:22 PM) <{POST_SNAPBACK}>
Hello Jordan,

Can you please use this function if not a problem, inside your unit. Thank you.

Best regards


No problem...it's working fine for me as described.

In Topic: Problem with LoadFromRegistry

15 July 2009 - 01:11 AM

I think I would read all the column position items into a temporary tList, and then sort that list by the destination position. After it's sorted, do the ChangePosition on the column that is to be moved. At the risk of some loss of generality, you could take advantage of the fact that you have set a reasonable maximum number of columns (1000, I think), so you could easily use the 32 bit pointer of the tList to hold both destination and source by using SHL 16. Each pointer in the tList would have the destination column number in the high-order 16 bits, and the original column number in the low order 16 bits. There would be room for 2^16 columns that way, and you would only need the one auxiliary tList data structure.

Of course, this all assumes that by processing the columns in destination order, the problem will be fixed. I think it will, but I haven't tried to prove it. It seems to me that some of the columns that were properly positioned were subsequently moved when other columns needed to be placed in front of them. If that's the case, then doing the columns in destination order ought to fix the problem.

I don't know if it matters whether you set the column positions first, and then set the other parameters of the columns, once it has been moved. That would be my approach, just to avoid other potential complications.