I'm evaluating different WPF grids for a current software project in our company. By reading your documentations, forum threads and trying your demos, I couldn't find out if your GridView control could meet our special requirements:
- multiple grouping (could be fixed groups, not necassary for user to change grouping at runtime)
- different formulas/expressions per cell not just per column
- formulas/expressions related to other cells in other columns and rows, i.e. formula in cell A1: "B1 + C3"
- possibility for user to change the formulas (maybe with your expression editor?)
Could you tell me if this is somehow possible and give me an example?
5 Answers, 1 is accepted
You can achieve your requirements as follows:
1. You can define group descriptors in xaml/ code-behind so that they are created initially and cancel grouping event afterwards/ remove the group panel.
2/3. You can work with our GridViewExpressionColumn and define the expression you want to be applied. Could you clarify what do you mean by setting an expression per cell, not per column ? Do you expect to be able to define different expressions for different items in a column ?
4. You can work with the expression editor as illustrated in our demos. Furthermore, you can take a look at this forum thread for additional information.
Let me know in case you need any further assistance.
the Telerik team
Thanks for your quick response!
2.: Yes I mean different expressions per item. So i.e. the ExpressionColumn-item could have another expression as ExpressionColum-item.
3.: By related to other cells/rows I mean, i.e. you have a grid with 3 columns: ExpressionColumn, UnitPrice and Budget. Is it possible to have an expression like "UnitPrices * Budgets" in ExpressionColumn. The different indexes of the items stand for different rows (item levels). In your demo the expression is always related to the same row (item level).
Basically, DataContext of a particular row is the corresponding data item and you can make calculations on it out-of-the-box with GridViewExpressionColumn. If you want to perform some custom logic, you will need to implement it in your business object and depends entirely on the structure of your application.
the Telerik team
ok, but can you tell me how high the effort is and what else I would have to implement manually? Just changing businss object won't do the trick, I think. Are the following steps the necessary steps I would have to do?
1. Change business object
2. Change/extend the GridViewExpressionColumn class to store different expressions per item
3. Change/extend the ExpressionEditor class/control to give the user the opertunity to enter expressions like this "UnitPrices * Budgets"
Is this possible at all or are the controls/classes sealed? Do you have examples how to do this?
Generally, what you want to accomplish may lead to quite undesirable results and could break the whole data engine of RadGridView. Each row depends on the underlying data item, each column - on the corresponding property. The case with GridViewExpressionColumn is a bit different as it does not expect a property, but rather an expression. However, in this situation again the expression should be the same for all items and it is defined on column, not on row level.
All the filtering/ grouping/ sorting functionality depends on this logic and changing it could result in unwanted behavior.
the Telerik team