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
80
Access the Group by level in a UltraGridGroupByRow
posted

Hi,

I need to apply formatting to my groupby header rows depending on the level of the group by level of that row.  For example, I am grouping by 3 columns, say A, B, and C.  If they Group by row refers to column A, I need to change the row's backcolor to red, if its B, I need to change the row back color to blue.

I'm looping through the rows UltraWinGrid.RowsCollection on my grid, and if the row is a group by row (check the IsGroupByRow property) I cast it to a Infragistics.Win.UltraWinGrid.UltraGridGroupByRow.  I can then see a non-public variable called:   GroupByRowLevel  in my watch window which gives me the index of the groupby row.  In my example above, if the group by row was A, this variable would be set to zero.  If row was on column B, it would be set to 1, etc.

However, this variable is not exposed (as far as I can find) in the UltraGridGroupByRow object.  If I try to call it directly my project fails to compile saying that the variable is protected.

Is there anyway I can access the level of the group by row I am on ?

Thanks,

  - Jagat

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     Hi Jagat,

    The GroupByLevel is internal and it's not exposed publicly as far as I can see. But it's easy enough to calculate it yourself. 

    All you have to do is walk up the Parent chain of the GroupByRow until you come to either null or a row that is not a GroupByRow. 

Children