Hi, I am new to infragistic I am trying to implement objectcontainerdatasource(MVP) with ultrawebgrid. The data that I am showing on the grid comes from a method that gives only 5 datarow at each call and has following signature
IList<businessentity> Method(int PageIndex,ref int TotalRecords).
So this method take page number and return me collection of business entity object with the total records into the database.Now I am getting data back and show pagecount as ultrawebgrid1.displaylayout.pager.pagecount = (int) TotalRecords/5 +1 . Since PageSize is 5. I handle Pageindexchange event each time someone clicks on pager and I get requested pagenumber from the (PageIndexChangeEventArgs e) e.NewPageIndex
Now my problem is when I call the method from pageindexchange event data is return to codebehind (that I can see in debugging) but data is not showing on grid at all.I did try enableviewstate=false but It is not working. I use ultrawebgrid1.databind() to check and see but it looks this show me some outofbound exception
can some one show me link where this type of custom paging is availble with objectdatasource ???
Thanks in advance
Hello,
Thanks for your interest in our products. I recently played with ObjectContainerDataSource in a WCSF projectwith UltraWebGrid and found that it worked fine (with the minor exception of one small bug in design time). However, I used only the declarative syntax and the grid was bound through its DataSourceID property.
Is there any chance that you are binding in some other way? For example, are you using the InitializeDataSource event of the grid for binding? Or for example, can you drop a standard built-in asp:GridView component side-by-side with UltraWebGrid and see if you are able to bind it correctly?
Any additional information will be helpful and will certanly provide additional clues.
Hi let me give you a quick recap of what I am trying to achive. I am doing custom paging and custom sorting.I am using MVP pattern so my data that I am assigning to objectcontainerdatasource is coming from presenter and I use setter method to set datasource at runtime as following syntax in presenter :
public void PresenterMethod(int pageNumber, int PageSize, ref int RecordCount){View.Mybusinessvariables = this._controller.GetMyVariables(pageNumber, PageSize, ref RecordCount);View.TotalRecords = RecordCount;}
in View I do following: here MyDataSourcce is objectcontainerdata source and dropdownlist contain pagesize so user can have custom pagesize
public IList<businessentity> Mybusinessvariables{set { MyDataSource.DataSource = value; }}
public int TotalRecords{set {UltraWebGrid1.DisplayLayout.Pager.PageSize = Int32.Parse(DropDownList1.SelectedItem.Text)+1;UltraWebGrid1.DisplayLayout.Pager.PageCount = (int)(value / Int32.Parse(DropDownList1.SelectedItem.Text))+1;}}
now I have return code for custom sorting it works fine and custom pagesize also works good but when I do pageindexchange event I do not get my grid updated even if I can see that MyDataSource.DataSource = value; is recieveing new data I am not using any datasourceintialize event and I am setting datasourceID at desing time only using datasourceId property
If you are able to work well with objectcontainer datasource it will be great if you give me hint through some sample