This question is locked. New answers and comments are not allowed.
I am trying to create cutom gridview column, like this:
| public class MyDataColumn : GridViewDataColumn |
| { |
| public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem) |
| { |
| var presenter = new TextBlock(); |
| var opp = dataItem as TestData; |
| if (opp == null) return presenter; |
| // Do something here ... |
| return presenter; |
| } |
| } |
I am able to add the column to grid before set ItemSource:
| Grid1.Columns.Add(new MyDataColumn |
| { |
| Header = "My Data Column", |
| IsReadOnly = true, |
| IsSortable = true, |
| IsFilterable = true |
| }); |
The column looks fine. However, sorting and filter are not there for the column. What should I do to enable them? Also, what should I do to support export for the custom column?
Thanks in advance.
P.S. I have create a sample project for this. Unfortunately, I could not attach a zip file with this post. If you need it to understand what I am trying to achive here, I can eamil it to you.
