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

[Solved] RadGrid inside RadSplitter

4 Answers 183 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 05 Oct 2009, 09:45 AM

I previously had a RadGrd nested like so:

RadSplitter => RadSplitter => RadGrid  (i.e. RadGrid nested 2 Splitters deep)

Then on the AjaxManager's ClientEvents-OnResponseEnd, my Javascript looked like so:

function setDimensions(sender, args) {  
    var splitter = $find(PageControls.RadSplitter1.id);  
 
    if (splitter != null)  
        splitter.resize(contentPaneWidth - 60, contentPaneHeight - 80);  
   

This worked perfect for resizing the 2nd level Splitter pane to the contentPane's width and height and thus the Grid to match.

Now, I've removed the 2nd Splitter and moved the Grid up one level.  I can get the pane's width and height still.  But how do I resize the grid?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Joshua
Top achievements
Rank 1
answered on 05 Oct 2009, 09:52 AM
is there a height and width property to the RadGrid or a command like 'resize'?

Thanks,
Joshua
0
Princy
Top achievements
Rank 2
answered on 05 Oct 2009, 10:34 AM
Hello Joshua,

After setting a pixel height to the RadGrid <div> wrapper, you can call the repaint method of the grid to resize the control. Here's an example:

js:
function ResizeGrid() 
    { 
        var grid = $find("<%=RadGrid1.ClientID %>");        
        grid.get_element().style.height = "800px"
        grid.get_masterTableView().get_element().style.height="800px" 
        grid.get_element().style.width = "1000px"
        grid.get_masterTableView().get_element().style.width="1000px" 
        grid.repaint();         
         
    } 

Hope this helps..
Princy.
0
Joshua
Top achievements
Rank 1
answered on 05 Oct 2009, 11:51 AM
Princy,

Thanks so much. Worked like a charm.

One more problem:

See the attached file.  There's a space between the first and second columns (noted by the red arrows).  This only shows up on the initial page load.  If, however, I click on a tree node to the left, to load a subdirectory, the radgrid reloads with the correct data and the space goes away.

Any ideas how to remove this from the initial page load?  Sorry to be picky, but I do try to keep professionalism consistent.

Thanks,
Joshua
0
Yavor
Telerik team
answered on 08 Oct 2009, 06:30 AM
Hello Joshua,

Based on the supplied information, it is hard to determine what is causing this spacing. To further track the issue, it will be best if you open a formal support ticket, and send us the problematic code, in the form of a small working project, for additional review and testing.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Joshua
Top achievements
Rank 1
Answers by
Joshua
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Yavor
Telerik team
Share this question
or