Ok. So how much longer are you guys going to put up with me? I've been writing software for almost 30 years now. You'd think I would wait just a little longer before writing about a problem. However, these new fangled forums are just too easy! Plus, it doesn't help that you try to respond as quickly as possible! (All tongue firmly in cheek.)
So, if figured out both problems:
1. If I remove the Gridview1.Sort.... line in the count_models procedure no more errors and sorting works perfectly, all columns. Is this due to my using an "order by" value that doesn't match what I was sorting by? Or, is there something else I'm missing? I've never used Views before and I've fallen in love. Is there something inherently wrong with them?
2. To fix the paging issue I changed the esSelect event so that it looks like this now:
Code:
protected void EsDataSource1_esSelect(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e)
{
ModelGridCollection coll = new ModelGridCollection();
e.Collection = coll;
e.Arguments.TotalRowCount = count_models();
}
protected int count_models()
{
ModelGrid eModel = new ModelGrid();
eModel.Query.es.CountAll = true;
eModel.Query.es.CountAllAlias = "Count";
if (eModel.Query.Load())
{
return Convert.ToInt32(eModel.GetColumn("Count"));
}
else
return 0;
//GridView1.Sort(ModelGridMetadata.ColumnNames.ModelSeries, SortDirection.Ascending);
}
Just to recap; I don't have to do these for normal tables.
Thanks again for creating such a great product and doing your best to help those of us who, even after all these years, are still handicapped!
Phil Mickelson