How to hide null columns in webdatagrid
I had used to following code in the client side to hide null columns
var cols = gGrid.get_columns().get_columnFromKey("reference");
cols.set_hidden(true);
However this returns the following error in IE
SCRIPT5007: Unable to set value of the property 'display': object is null or undefined
and the following error in Chrome
Uncaught TypeError: Cannot set property 'display' of null
The code works in Firefox,
Hi Niranjani,
The behavior you're encountering with the WebDataGrid is unexpected.
I have attached a sample project I used to test this in IE, Chrome, and FireFox to find that I am unable to reproduce this issue. Please note, I am referencing build number 14.1.20141.2254 in Infragistics ASP.NET 2014 Volume 1.
Please run the sample and let me know if it works for you.
Hi Jose,
I am using the simlar code which is in sample
var grid = $find("WebDataGrid1"); var column = grid.get_columns().get_columnFromKey("DepartmentName"); column.set_hidden(true);
I am using Infragistics4.Web.v13.1 and checked that it works only in Firefox in MAC as well as in Windows OS
Tested in
Safari8 and Chrome33 in MAC OS 10.8.5
IE 9,10 and 11 ; Chrome 33 in Windows 7
It doesn't work in any of the above listed browsers .
I am clueless as why the mentioned error occurs in all the listed browsers except Firefox.
Thank you for the update.
I was not able to reproduce this in my environment using the sample I provided in my previous post. Did you perform your tests using my sample? If not, please create a sample, or modify the sample I've provided so that it reproduces the issue you're encountering. I will then use the sample to test this in my environment.
I am looking forward to your update.
Were you able to use my sample as reference to resolve this issue?