This is a migrated thread and some comments may be shown as answers.

RadGrid column select/deselect does not resize grid

10 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sophie
Top achievements
Rank 2
Sophie asked on 21 Jan 2013, 05:43 PM
Like in this example DEMO, my grid has the ability to show a menu to select and deselect columns. But on the demo, the columns resize to the grid size. Mine doesnt unless some postback is done. How do you resize grid on selecting columns checkbox from the menu?

Edit:
I got this function in javascript that calculate all column width, then apply the width to the grid style. That works well when all columns are there.
Each column must remain at a fixed size (a switch i added with the UniqueName of each column) that way i get the right width. Since i can remove a column, orderIndex can't work here.
So when i click the drop down menu and uncheck a column to hide it, the resize function doesnt work anymore because i can't find the "visible" property of the column, so i get a width containing all columns.
My tableView has a tableLayout fixed.

So, what i need here, is a way to get the visibility of the column to properly resize my grid with it.

10 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Jan 2013, 06:51 PM
Hello Sophie,

Have you tried using the ResizeGridOnColumnResize property as demonstrated in the following example?
http://demos.telerik.com/aspnet-ajax/grid/examples/client/resizing/defaultcs.aspx

I hope this will prove helpful. Please give it a try and let us know about the result.

 Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Sophie
Top achievements
Rank 2
answered on 25 Jan 2013, 02:13 PM
Hello Eyup, I'll give it a try, thanks.
0
Sophie
Top achievements
Rank 2
answered on 04 Mar 2013, 03:29 PM
Hello, works when i resize a column but it's worst when i unselect a column. Grid doesnt resize unless theres a postback. See picture. I went to see the demo http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/headercontextfiltermenu/defaultvb.aspx but I still get white space on the right side of the grid.

Here are my grid properties:
<div style="width:750px">
  <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true" EnableHeaderContextMenu="true" Width="100%">
    <ClientSettings AllowColumnHide="true" >
      <Resizing AllowColumnResize="true" EnableRealTimeResize="true" />
    </ClientSettings>
    <MasterTableView AllowMultiColumnSorting="false" 
      AllowCustomSorting="false"
      TableLayout="Auto"
      AutoGenerateColumns="true"
      EnableHeaderContextMenu="true" >
    </MasterTableView>
  </telerik:RadGrid>
</div>

Please help. Thanks.
Edit: I found the same issue here: http://www.telerik.com/community/forums/aspnet-ajax/grid/hide-grid-column-client-side-can-other-columns-automatically-resize.aspx But theres no answer. This happens on IE to on my side. Using IE 8.0.6001.18702. And our team has IE as a primary browser for our clients so i need a workaround.
0
Sophie
Top achievements
Rank 2
answered on 04 Mar 2013, 04:53 PM
I found the property that changed everything... Aparently, ClipCellContentOnResize=false AND tableLayout="auto" is the miracle proprety to use. If i don't have that property to false, in IE, the grid content doesnt resize grid columns when hiding one. Is that a bug?
0
Eyup
Telerik team
answered on 07 Mar 2013, 08:18 AM
Hi Sophie,

I am afraid we are not able to replicate the issue locally. Please provide us the exact steps to reproduce the issue with the demo from my previous post or open a support ticket to send us a sample runnable application demonstrating the erratic behavior. Thus, we will be able to further analyze the problem and provide a proper solution.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Sophie
Top achievements
Rank 2
answered on 07 Mar 2013, 02:26 PM
Hey Eyup,
I don't need to create a demo... your own demo has that behavior in IE 8.... http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultvb.aspx?#qsf-demo-source
See the pictures attached. This is exactly the behavior im getting in my project.
And if you hit save settings to create a postback, the grid resize.
Thanks.
0
Sophie
Top achievements
Rank 2
answered on 07 Mar 2013, 04:11 PM
Hey, I got an answer on another post, here http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-hidding-column-resize-issue.aspx And apparently its a work in progress. The guy asking about the issue has the same IE version has me.
0
Eyup
Telerik team
answered on 12 Mar 2013, 08:31 AM
Hello Sophie,

I am glad that you have managed to find a working workaround through our forums.
As my colleague had explained in the thread, it is a browser related behavior and they are working on fixing it.

Thank you for your understanding.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Martin
Top achievements
Rank 1
answered on 13 Mar 2014, 03:12 PM
On IE11, I had to remove <Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="true" /> for this to work. TableLayout was set to Auto though.
0
Eyup
Telerik team
answered on 18 Mar 2014, 11:38 AM
Hello Martin,

It is good to hear that you found a suitable solution for your scenario.
However, please note that column resizing should work as expected with static headers as well except in case when you have frozen columns set, which is not supported:
http://www.telerik.com/help/aspnet-ajax/grid-frozen-columns.html

Regards,
Eyup
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
Grid
Asked by
Sophie
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Sophie
Top achievements
Rank 2
Martin
Top achievements
Rank 1
Share this question
or