Hello,
I use v12.2 and after I've read many post WebDataGrid works. With one exception. If I use client-side binding, the grid loses the property VirtualScrolling. When I load the data on server side it works. Do you have any idea?
Below is the code I am using
Best regards
Manfred
<ig:WebDataGrid ID="wdgSEARCH" runat="server" Width="99.5%" Height="99.5%"
DataKeyFields="ProjektID" StyleSetName="Office2007Black" EnableAppStyling="True"
AutoGenerateColumns="False" EnableAjax="False" EnableDataViewState="True" BorderStyle="None" StyleSetPath="~/ig_res/"
EnableClientRendering="true">
:::
<Behaviors>
<ig:Selection CellClickAction="Row" RowSelectType="Single"></ig:Selection>
<ig:VirtualScrolling AverageRowHeight="30" DataFetchDelay="500"
RowCacheFactor="3" ScrollingMode="Deferred">
</ig:VirtualScrolling>
</Behaviors>
private void InitialSearchGrid()
{
this.wdgSEARCH.EnableClientRendering = true;
this.wdgSEARCH.Behaviors.VirtualScrolling.Enabled = true;
wdgSEARCH.DataSource = CommonData.getLocProjects("XXXXX");
wdgSEARCH.DataBind();
}
function getLocationProjects(Customer) {
PageMethods.getLocProjects(Customer, onSucess, onError);
function onSucess(result) {
var grid = $find('<%=wdgSEARCH.ClientID%>')
if (grid != null) {
var source = result.Table;
grid.EnableClientRendering = true;
grid.set_dataSource(source);
grid._pi.show(grid);
grid.applyClientBinding();
grid._pi.hide(grid);
function onError(result) {
alert("Keine Daten gefunden!"); }
Hello Mani_Infineon,
VirtualScrolling is not intended to work with client-side binding. When you bind the grid in javascript, the whole data source is sent to the client, so there is no need to request additional data.
If you have any further questions, please do not hesitate to ask.
Hello Nikolay,
thanks for your answer.
To solve my problem, I did the following trick.
I enclose the grid with a div. the div, I hide from the style property.
document.getElementById('divSearch').style.display = 'none';
Because I have to load the data only once, I do it on the server side when initializing the page (also binding etc.).
protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
InitialSearchGrid();
wdgSEARCH.DataSource = CommonData.getLocProjects("");
After Page Init and do some other stuff on client side i make the div visible.
document.getElementById('divSearch').style.display = 'block';
This has nothing to do with the technics of the grid, but allows me a quick load of a large dataset and virtual scrolling. By the way: loading time diffence is 20 Seconds
Hello Manfred,
Thank you for sharing your solution with the community.
If you have other questions, please do not hesitate to ask.