Hi, I'm using WebDataGrid without setting any width to the grid or columns because I want the columns to increase/decrease their size accordingly to fit the contents of the data.
However it's not working for some of my columns. The header text either gets cut off for columns that has no data or wraps around even though I've set "white-space:nowrap" in igg_HeaderCaption.
Is there a place where I can set "table-layout:auto" to the grid header table?
Thanks!
Hello,
If you set the _adjustGridLayout function back to the original after the columns have been sized then the performance should improve. This can be done by adding the following line to the end of the resizeGrid function:
$IG.WebDataGrid.prototype._adjustGridLayout = $IG.WebDataGrid.prototype._originalAdjustGridLayout;
Let me know if you have any questions with this matter.
Hi Alan,
Its very critical item for me, I had added your suggested code to my client;s application.
Please run attached sample application and see alert message continues calls. (just for your information I added this)
if you remove that alert and run the page then you have to open task manager and verify IEXPLORER.exe CPU usage.
please help me on this as soon as you can.
Thank you very much.
Do you also reproduce this with any of the samples that I provided earlier in this thread or only your application? Also what specific version of Internet Explorer are you using?
How you doing?
Here I am back to give you little trouble again, hope you don't mind it !! :)
Last time you provided me one JavaScript function which resize the header. I observe there is something weird happening with this script.
Scenario is, If I left my webdatagrid application page for 20-30 mins idle then some kind of JavScript message throws out of the window after this period. Please refer attached screenshot for the same. I investigated and found because of code added to fixing header issue is causing this message. do you have any idea about this ?
The grid has logic to calculate a size for the grid based on the widths of the columns and when setting the widths on the client it stores the width in client state properties and that is being used on a post back rather than Unit.Empty. This results in the grid being smaller than needed because this calculation doesn't include the padding for the cells which come from css.
You can correct this behavior by resetting the value stored in the client state properties on the client after setting the width of the cell by adding the following line of BLOCKED SCRIPT
col._set_value($IG.ColumnProps.Width, "");
The loop to set the column widths will now look like the following:
for (var colIdx = 0; colIdx < columns.get_length(); colIdx++) { var col = columns.get_column(colIdx); col.set_width(widths[colIdx] + 'px'); col._set_value($IG.ColumnProps.Width, "");}
Let me know if you have any questions.