Here are my 3 methods:
protected void LLBLGenProDataSource2_1_PerformSelect(object sender, PerformSelectEventArgs2 e)
{
LLBLGenProDataSource2_1.EntityCollection = _listaDocs;
LLBLGenProDataSource2_1.DataBind();
}
protected void LLBLGenProDataSource2_1_PerformWork(object sender, PerformWorkEventArgs2 e)
{
}
protected void LLBLGenProDataSource2_1_PerformGetDbCount(object sender, PerformGetDbCountEventArgs2 e)
{
e.DbCount= _listaDocs.Count;
}
As I have understood the LLBLGenProDataSource2 can work in disconnected mode like the dataset. What I need is just a gridview where I can page and sort the (not much) data collection without changing any data. For this reason I left the the performwork method empty. But I still get an error with the binding (Collection is readonly)
Another thing I still do not understand is if I must bind the datasource before binding to the grid so I also tried this in the inizializer part:
public EntityCollection<PubblicazioneEntity> ListaDocs
{
set
{
_listaDocs = value;
System.Diagnostics.Debug.Write(value.Count);
BuildGrid();
LLBLGenProDataSource2_1.DataContainerType = DataSourceDataContainerType.EntityCollection;
LLBLGenProDataSource2_1.LivePersistence = false;
LLBLGenProDataSource2_1.EnablePaging = true;
LLBLGenProDataSource2_1.EntityCollection = _listaDocs;
LLBLGenProDataSource2_1.DataBind();
GridView1.DataSource = LLBLGenProDataSource2_1;
GridView1.DataBind();
}
}
I'd like if you could give me (or point me to) any examples where all the code and binding is done in code behind.
As I said I need the Disconnected-ReadOnly mode but I think that it would be useful also the Connected mode.
I'm also trying to use the Model View Presenter pattern and in this pattern there is no direct connection to the Model (where I suppose the DataAccessAdapter belongs) so the indirection from the aspx page (the view) it is very important.
Thanks