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

Grid Repaint

1 Answer 271 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kent
Top achievements
Rank 1
Kent asked on 09 Mar 2011, 11:47 PM
I am having some trouble using the repaint method??
The problem I am having is that the filter is a set of textboxes, drop-down, etc.  When I hide them the grid moves up and expands to fill the available space, as I would like it to do.  But the grid contents just move up and dont expand.

Here is my javascript code (I am able to access the grid, but the repaint method does not seem to exist):
case "tbrQueryPanel":
    var filter = contentWin.document.getElementById("filter");
    if (filter) {
        if (filter.style.display == '') {
            filter.style.display = 'none';
        }
        else {
            filter.style.display = '';
        }
    }
    var grid = contentWin.document.getElementById("Grid_RadGrid");
    grid.repaint();
    break;

Here is my Grid (scrolling and static headers are enabled, and it is nested inside a user control, which is nested inside a radpane, inside another container):
<telerik:RadScriptManager ID="ScriptManager" runat="server" />
<telerik:RadGrid ID="RadGrid" runat="server" Width="100%" Height="100%"
    Font-Names="Verdana" GridLines="Horizontal" AllowSorting="True" ShowGroupPanel="True" 
    Skin="Office2007" AllowPaging="True" PageSize="50" AutoPostBack="True"
    <MasterTableView>
        <HeaderStyle Wrap="false" />
    </MasterTableView>
    <ClientSettings AllowDragToGroup="True">
        <Scrolling UseStaticHeaders="true" AllowScroll="True" SaveScrollPosition="True"/>
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
    <PagerStyle AlwaysVisible="true" />
    <ExportSettings ExportOnlyData="true" IgnorePaging="true"/>
</telerik:RadGrid>
...

1 Answer, 1 is accepted

Sort by
0
Galin
Telerik team
answered on 15 Mar 2011, 01:02 PM
Hello Kent,

Is not good idea to have the control id the same as the control/class name. The good practice is:
<telerik:RadScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadGrid ID="RadGrid1"...>
 .....

For repainting the Grid use the following javascript:
var grid = $find('RadGrid1');
grid.repaint();



Best wishes,
Galin
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Kent
Top achievements
Rank 1
Answers by
Galin
Telerik team
Share this question
or