Infragistics UltraGrid - How to use displayed values in group by headers when using an IEditorDataFilter?

StackOverflow https://stackoverflow.com/questions/22964651

  •  30-06-2023
  •  | 
  •  

Question

I have a situation where I'm using the IEditorDataFilter interface within a custom UltraGrid editor control to automatically map values from a bound data source when they're displayed in the grid cells. In this case it's converting guid-based key values into user-friendly values, and it works well by displaying what I need in the cell, but retaining the GUID values as the 'value' behind the scenes.

My issue is what happens when I enable the built-in group by functionality and the user groups by a column using my editor. In that case the group by headers default to using the cell's value, which is the guid in my case, so I end up with headers like this:

Column A: 7F720CE8-123A-4A5D-95A7-6DC6EFFE5009 (10 items)

What I really want is the cell's display value to be used instead so it's something like this:

Column A: Item 1 (10 items)

What I've tried so far

Infragistics provides a couple mechanisms for modifying what's shown in group by rows:

  1. GroupByRowDescriptionMask property of the grid (http://bit.ly/1g72t1b)
  2. Manually set the row description via the InitializeGroupByRow event (http://bit.ly/1ix1CbK)

Option 1 doesn't appear to give me what I need because the cell's display value is not exposed in the set of tokens they provide. Option 2 looks promising but it's not clear to me how to get at the cell's display value. The event argument only appears to contain the cell's backing value, which in my case is the GUID.

Is there a proper approach for using the group by functionality when you're also using an IEditorDataFilter implementation to convert values?

Was it helpful?

Solution

This may be frowned upon, but I asked my question on the Infragistic forums as well, and a complete answer is available there (along with an example solution demonstrating the problem):

http://www.infragistics.com/community/forums/p/88541/439210.aspx

In short, I was applying my custom editors at the cell level, which made them unavailable when the rows were grouped together. A better approach would be to apply the editor at the column level, which would make the editor available at the time of grouping, and would provide the expected behavior.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top