Following the blog example for adding a FakeColumn, I added a calculated column. I then bind a collection of that data to the DataGridView control. It works great, except that it won't sort when I click on the columns that are calculated. By "won't sort", I mean that clicking on the column header does not change the order of the rows.
Any thoughts on what I should look at?
Thanks,
Dan
Code:
GradestableCollection gradeCollection = new GradestableCollection();
gradeCollection.QueryReset();
gradeCollection.LoadAll();
ResultsDataGridView.DataSource = gradeCollection; // this works, but it doesn't sort on the two calculated columns
// now, an excerpt from Gradestable.cs
// the two columns, referralSpeed and referralRecommendation are calculated from other columns (but not in a way that could reasonably be done with SQL in a SELECT statement.)
namespace BusinessObjects
{
public partial class Gradestable : esGradestable
{
public int referralSpeed
{
get { return CalculateReferralSpeed(); }
set { }
}
public string referralRecommendation
{
get { return CalculateReferralRecommendation(); }
set { }
}
protected override List GetLocalBindingProperties()
{
List props = new List();
props.Add(new esPropertyDescriptor(this, "referralSpeed", typeof(int)));
props.Add(new esPropertyDescriptor(this, "referralRecommendation", typeof(string)));
return props;
}