Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
410
FormularCondition Examples
posted
Hi

Are there any examples on how to use FormulaCondition? What I found in the
help is not very useful.

I want to set the color of column based on another column.

I can do this in the InitializeRow-Event, but if there is a great number of
records this is very slow. The second method (which I used right now) is to
use the IUIElementDrawFilter which is very fast, because only the columns
which are visible are processed. But I have to write a lot of code.

I think to use the FormulaCondition is also very fast and is much less code
then the second method I mentioned, but i cannot find a useful examples.

My grid has 3 columns. The grid is filled from a database and I add an
unbound column to show a status. I want to change the backgroundcolor of
this unbound column. The names of the three columns are "ID", "DateIn" and
"DateOut". The name of the grid is dataGrid. I want to set the color to
green if DateIn and DateOut are not DBNull. It should be set to yellow if
only DateOut is DBNull and red if both are DBNull.

Can I use FormularConditions for this? And how to address the columns in the
formula?

Thanks a lot for answering my questions
Michael
Parents Reply Children