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

Setting grid width via javascript stopping frozen columns working?

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Holly
Top achievements
Rank 1
Holly asked on 02 Nov 2012, 04:44 PM
I'm setting the width of my radgrid  and the scrollarea height as a percentage of the window size like so:
function GridCreated(sender, args) {
      var scrollArea = sender.GridDataDiv;
      var gridHeader = sender.GridHeaderDiv;
      scrollArea.style.height = $telerik.$(window).height() / 2 - gridHeader.clientHeight + "px";
      sender.get_element().style.width = ($telerik.$(window).height() * .85) +"px";
     
  }

I've then got  the below clientsettings
<ClientSettings>
      <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="2"/>
      <ClientEvents OnGridCreated="GridCreated" />
   </ClientSettings>

The frozen columns aren't frozen.
Yet if I set the width of the grid  as a property in the <Telerik:RadGrid tag instead of by javascript the frozen columns stay frozen as expected.
Do you have any idea why this might be happening?
Thanks

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Nov 2012, 10:32 AM
Hi,

I have used the provided code and prepared a sample runnable project following your scenario. However, I was not able to replicate the described problem. The only thing which I changed is to add repaint() method to the grid at the end. Give it a try and see what is the difference in your case.

Greetings,
Pavlina
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.
Tags
Grid
Asked by
Holly
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or