We have had our share of problems with WebDataGrid and one remains. When we populate the data from WCF Data Services the first load hits to a dynamic JavaScript error which is apparently related to scrollbar. Here's the dynamic script source:
_onHorizontalScrollBarWidthInit: function (scrollBar) { var scrollDiv = null; if (this._grid._rows.get_length() < 1) scrollDiv = this.__getFirstScrollDiv(); else { var row = this._grid._rows.get_row(0).get_element();
The code goes on, but the last one causes Microsoft JScript runtime error: 'this._grid._rows.get_row(...)' is null or not an object.
Apparently the rows in there is null. To make things more complicated, if I sort the data the grid shows the data and everything from there seems to be working just fine... until I reload the data to the grid!
Any ideas or workarounds?
Hi AriV,What version and build number are you using? If you don't have the latest Service Release, could you upgrade to that? Then let us know if the problem persists. Also, looks like you have column fixing on?
regards,David Young
Hi!
This is the version number I dig out from Infragistics4.Web.v10.3: 10.3.20103.1013. It seems to be the latest - I ran the Version Utility against the project and the message was "Nothing for us to upgrade."
Can you be more specific about column fixing?
Here's the definition of the grid on ASPX page:
<ig:WebDataGrid ID="_grid" runat="server" Width="100%" DataKeyFields="id" AutoGenerateColumns="False"EnableAjax="False" EnableDataViewState="True" OnRowSelectionChanged="_grid_RowSelectionChanged"OnDataBinding="_grid_DataBinding">
The data is not neccessarily bound to the grid on Page Load, but later on when the user has selected several values from dropdowns. The grid data source is a WCF Data Service and pretty much defined like this:
MyData data = MyDataService(new Uri(myserviceaddress)).MyData;
_grid.DataSource = data;
_grid.DataBind();
The problem seems to be somehow tied to EnableDataViewState because when I turn it off everything works. The only problem then is that I have to load the data on every postback or implement some other ways to cache the data.