I have created a custom column by inheriting from GridViewDataColumn (and GridDataCellElement and BaseGridEditor and LightvisualElement)
When used, the column is databound to an object (often an Entity Framework Entity).
If I try to sort on the column, it doesn't work in any meaningful way, probably because the grid doesn't know how to sort the objects the column is databound to.
Is there a way for the column to control how it is sorted ?
I'd rather not use the custom sorting features of the grid, then I would have to implement it on all grids using the column (the column is rather generic and used all over).
The logic I would like to implement is quite similar to logic of the DisplayMemberSort property in GridViewComboBoxColumn (sorting on something else than the value the column is databound to).
Peeking at the code of GridViewComboBoxColumn, it seems as it is implementing this functionality by overriding the GetValue method, and looking at the GridViewDataOperation flag. However, the GetValue method is internal, so I can't do the same in my column class.
Thanks /Hannes
When used, the column is databound to an object (often an Entity Framework Entity).
If I try to sort on the column, it doesn't work in any meaningful way, probably because the grid doesn't know how to sort the objects the column is databound to.
Is there a way for the column to control how it is sorted ?
I'd rather not use the custom sorting features of the grid, then I would have to implement it on all grids using the column (the column is rather generic and used all over).
The logic I would like to implement is quite similar to logic of the DisplayMemberSort property in GridViewComboBoxColumn (sorting on something else than the value the column is databound to).
Peeking at the code of GridViewComboBoxColumn, it seems as it is implementing this functionality by overriding the GetValue method, and looking at the GridViewDataOperation flag. However, the GetValue method is internal, so I can't do the same in my column class.
Thanks /Hannes