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
20
RowIndex inside formula
posted

Hi, could you help me?

How can I get a RowIndex inside formula?

Sample:

Column.Formula = "if (odd(RowIndex), [value1], [value2])"

Thanks, Alexandr.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Alexandr,

    I don't think there is a function that will get you the index of a row. But there are a couple of ways you could achieve what you want.

    What I would do is simply add an unbound column your grid and hide it. Use the InitializeRow event to populate this column with the row's index and then use that column to get the index into your formula using the column name.

    Another option would be to just use the InitializeRow event to populate the value of the formula column yourself - without using a formula.

Children
No Data