I feel like an idiot posting this question but I though at the end of the day it might be useful to some other lost developer soul out there...
I thought it should be trivial task, but browsing the CSOM online help here:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR35
didn't help me much should I be looking at another url for Infragistics35.Web.v11.1?
Also for some reason the utility function to get the grid reference is not available on my page as typeof(igtbl_getGridById) returns undefined
Any ideas what I can try and most of all is it possible to show/hide a column on the client side?
Thank you
Emil
Hello Emil,
You can use grid’s “Initialize” client event to resize the grid from Client-Side if your application logic does not require something different:
var grid = $find("WebDataGrid1");
grid.get_element().style.width="100px";
grid.get_element().style.height="100px";
You can try this and see if it will fit your scenario.
Thanks Dave,
this is what works for me for WHDG (ajax toolkit lib in not avail in app so using get ElementById):
var grid = document.getElementById("ctl00_MainContent_WebHierarchicalDataGrid1"); grid.control.get_gridView().get_columns().get_columnFromKey("entitlementdesc").set_hidden(!checked);
I worked this out in debug session browsing the object model at runtime.
Now I have another question, when toggling the visibility of a column (it works like a dream by the way) with only one problem:
Once a column is shown the width of the visible columns are re-calculated to make space for the newly displayed column, but once the column is hidden the width of the visible columns is not recalculated to take the space of the hidden column instead the columns after the hidden ate shifted forward and the grid ends up with empty space after the last visible column see the screan shot below:
Description column shown:
Description column hidden and the space left on the right:
Now my question is what is the best event to use to re-initialise the column width?
Hi Emil,
The piece of code you have igtbl_getGridById, is for the UltraWebGrid. The WDG and WHDG are based off the Microsoft AJAX standard and are therefore found using $find(id). Once you have the grid, find the column in the row island of intereset and hide it. For example:
grid.get_gridView().get_columns().get_column(0).set_hidden(true); // for WHDG in top level
grid.get_columns().get_columnFromKey(key).set_hidden(true);// for WDG
regards,David Young