Forgive my noob-ness but what is the difference between the WebDataGrid and the WebGrid?
Same for the WebDataTree and the WebTree.
Hello,
In a nutshell, WebDataGrid and WebDataTree are both built on top of our Aikido framework. Aikido is our own asp.net control framework that lets us build lighter, faster web conrols and uses ASP.Net AJAX for all ajax communication between client/server. You can read more about it here :
https://es.infragistics.com/help/aspnet/web-whats-new-in-2012-volume-1#wdg_whdg_excel_style_filtering
All the newer controls that we've been building for past year and a half are all based on top of this framework. We will be re-writing some of our existing controls and moving others over to our Aikido framework in the upcoming releases.
Hope this helps.
Taz.
How do the two grids compare if the user has javascript disabled? Taking into account addons to firefox like NoScript where the user selectively disables or has to enable javascript for a site...
Neither of the grids will be functioning properly without java script.
The GridView would be a better choice for that scenario.
Hi,
how will WebDataGrid support custom paging like fetching limited number of records per paging in grid?
In UltraWebGrid, we have properties like the below ones
gridInstance.DisplayLayout.Pager.AllowPaging = true;
gridInstance.DisplayLayout.Pager.AllowCustomPaging = true;
gridInstance.DisplayLayout.Pager.PageSize = 50;
gridInstance.DisplayLayout.Pager.StyleMode = PagerStyleMode.CustomLabels;
gridInstance.DisplayLayout.Pager.CustomLabels = PagerLabel; //PagerLabel is a string array
So the above properties helps the grid to AllowCustomPaging and show only 50 records per grid page. if the page index changes we can fetch next 50 records from the database.
like wise what are the properties in WebDataGrid which enables custom paging. I can only have below properties but no custompaging which is like in ultrawebgrid.
Paging paging = new Paging();
paging.Enabled = true;
paging.PagerMode = Infragistics.Web.UI.GridControls.PagerMode.Numeric;
paging.PageSize = 50;
paging.QuickPages = 5;
paging.FirstPageText = "<<";
paging.LastPageText = ">>";
paging.PagerAppearance = PagerAppearance.Both;
gridInstance.Behaviors.Add(paging);
Also, what is the use of "EnableDataViewState" property?
Please provide some inputs on this as soon as possible, as we are in the process of evaluating and upgrading the Infragistics controls from older version to the latest version.
Thanks
The WebDataGrid is actually smarter. It works off the data source. If the data source is able to page (CanPage=True) the grid uses the data source control to fetch only the rows requested. Only in the cases of simpler data source (like an array of records) it does enumerates from the top and skips N number of records from the previous pages and then binds to the requested range. The page numbers are calculated off of the data source properties (Length, Count, etc) as well.
You are correct there is a way in the UWG to do just that, but in the default case it simply binds to the whole thing and then trims the excess.
The EnableDataViewState property was added partially for the paging benefit. If it is set to True all of the original data is stored in the view state for the range of the rows the grid is bound to. Next time there is a post back the data is restored from the viewstate and not pulled from the data source again; if a page is switched only one request is made to the data source for the next range of rows. If on the other hand the property is False the grid will do 2 requests to the data source: one for the current page, one for the next page.
Ok, I think I understand what is happening in my example now.
My requirement is simple. I need to display only 50 records per page, and hence I want to fetch only 50 records from the database instead of fetching all 3 million records.
Page load event of the page looks like this:
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) {
int PageIndex=0; //Initially the fist page is loaded BindDataSource(CONNECTIONSTRING, PageIndex); //this will fetch only first 50 records from the DB } }
protected void Grid_PageIndexChanged(object sender, PagingEventArgs e) {
BindDataSource(CONNECTIONSTRING, Grid.Behaviors.Paging.PageIndex); //supposing the user selected Page Number 3, this index will have a value of 2. The DB call will fetch the required 50 records this time from the DB.
//Based on what you are saying, the WebDataGrid is smartly looking for 100th-150th records, which do not exist in the datasource (since I am not fetching all 3 million records). Hence I see a blank data grid.
}
Is there any way out?
For the WDG you need to use ObjectDataSource and implement paging logic off of it.
Hello Mypost,
You may use the Custom Pager sample as a base.
Regarding the ObjectDataSource you should enable paging implement it in the Select method using startRowIndex and maximumRows :
https://docs.microsoft.com/en-us/previous-versions/dotnet/articles/aa479347(v=msdn.10)?redirectedfrom=MSDN
I am attaching a simple sample of WebDataGrid with Custom pager and bound to ObjectDataSource.
I have not included the ig_res folder in order to reduce the size of the attachment.
Let us know if you need further assistance regarding this.
Attached is a simple sample of this functionality. Hopefully this is what you are looking for.
Just make sure to create an ig_res folder with the Default style set in it.
Is there any example of ObjectDataSource to implement custom paging?