We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Column width stretched when hiding other columns

Hey,

Im working with the version 9.4.0.62 with server mode and the gridbuilder.
I have several groups of columns, with a fixed width for each Column, that need to be hidden or shown through a click on the corresponding group in a listbox -> please refer to the screenshots I attached.
In those screenshots you can see that when I hide the first 5 Columns contained in the first group the other columns are stretched but the headers are not, resulting in a displaced grid.

The remaining visible Columns should instead keep their width they had before.

I currently show / hide the Columns on the clientside through javascript the moment the group is selected / deselected in the listbox with this code:

var gridObj = $find("Grid");
.
.
.
while ( currentindex < endindex ){
gridObj.hideColumnByIndex(Number(currentindex));
currentindex ++;
}

Thanks in advance,
Julian





Streched_Columns_54befbb7.rar

5 Replies

RR Ranjithkumar R G Syncfusion Team November 11, 2011 05:51 AM UTC

Hi Julian ,

Thanks for using Syncfusion products.

We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple sample, video demonstrating the working of the sample and the same can be downloaded from the following links.

Sample link:
http://www.syncfusion.com/downloads/Support/DirectTrac/87196/showhide2032196791.zip

Video link:
http://www.syncfusion.com/downloads/Support/DirectTrac/87196/video-1-479620733.zip


Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give us your code snippet of your project which reproduced the issue or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.

Please let us know if any concerns.

Regards,
Ranjithkumar




JU Julian November 11, 2011 03:14 PM UTC

Hey Ranjithkumar,

Thanks for your response and the sample.
I actually found 2 different ways to reproduce the problem

1. Giving all columns a fixed width with .Width(xxx)
-> I've modified the sample this way, along with two buttons to hide / show the fields that were hidden on pageload in the original sample.

2. When the width of all columns together is smaller than the gridwidth. In this case the problem occurs even when there are columns without fixed width

Since I could now find out the exact circumstances in which the problem occurs I managed to come up with a workaround:
I Add an additional Column at the very end of the grid with an empty headertext and no fixed width.

Like this:
column.Add("Filler").HeaderText("");

This is enough for my project to work but it would be great to either document the requirement of a "fillerfield" or to fix the problem when all columns have a fixed width.

Regards, Julian



showhide2032196791_c0890509.rar


RR Ranjithkumar R G Syncfusion Team November 16, 2011 04:05 AM UTC

Hi Julian,

Thanks for your update.

We are glad to know that you found a workaround to fix the problem.
We would like to analyze more on this issue and then we will update the documentation regarding the issue.

Please let us know if you have any concern.

Regards,
Ranjithkumar.



JB Jason Beal January 26, 2012 09:14 PM UTC

I have also experienced this several times. We are also hiding particular columns. After doing some digging with Firebug via inspecting the elements and examining the widths of elements under the GridHeader div and the GridContent div, I have found that the widths of the GridHeader and GridContent divs do not match.

The GridHeader has a style set on each element to set its width, however, when clicking on the col in Firebug, it shows the actual width to be much higher than the style width.

The GridContent also has a style set on each element to set its width and when clicking on the col in Firebug, it shows the actual width to be the same as the style width.

Our resize column issue is still apparent.




RR Ranjithkumar R G Syncfusion Team February 10, 2012 04:14 AM UTC

Hi Jason,

Sorry for the delay in getting back to you. We suggest you to create an incident regarding your query in Direct Trac by using your Direct Trac account as your query as it is related to source level issue, so that we will be able to provide you the patch if the development team confirms it as an issue and fix it.

Please let us know if you have any concern.

Regards,
Ranjithkumar



Loader.
Live Chat Icon For mobile
Up arrow icon