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

How to have a RadGrid totally filling a Radock

4 Answers 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 02 Mar 2009, 03:40 PM
Hello,

I have a floating windows created with a RadDock, it constains a RaGrid filled with lected items, since v 1314 I am unable to have the grid filling the display area of radDock, seems that some border or padding somewhere in RDock make reasoning on width veru difficult especially when the windows is subject to skin change.

IE7 or FF

Here is part of my code:
<telerik:RadDock ID="GridDock" Title="Selected Page" Top="150px" Left="400px" style=" margin-left:auto; margin-right:auto; min-width:305px;min-height:200px;" DefaultCommands='PinUnpin' Pinned="false" DockMode="Floating" runat="server" >   
<Commands>   
<telerik:DockPinUnpinCommand />   
<telerik:DockExpandCollapseCommand />   
<telerik:dockcommand autopostback="true" name="addTab" Text="Add new" />   
</Commands>   
<ContentTemplate>   
<div style="width: 300px; ">   
<telerik:RadGrid ID="RadGrid2" runat="server" GridLines="None" Width="100%" AutoGenerateColumns="False">  
 
 
 

 

 

You see here that I take 305px for RadDock and 300px for its contentTemplate: its the only way to avoid scrolling bars on each side.
But I have a ugly space on the right of grid.

Thanks for some help fitting perfectly grid in dock independantly of skin.

CS

 

 

 

 

 

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 Mar 2009, 09:43 AM
Hello Christian,

When you set width to a RadDock, the actual available space for content is less than this width, because the dock's borders take up some space. This may be unexpected by some people, but otherwise the dock itself will take up more space than specified, because the borders would add up to the dock's width.

In addition, RadGrid by default has borders for its wrapper <div>. No matter what the RadGrid width is, these borders add up to the width and depending on the layout, scrollbars may appear - this is normal and is according to the W3C CSS specification.

So you have two options:

1) Remove the RadGrid borders and set Width for RadGrid, which is equal to the RadDock width minus the left and right dock border widths, e.g. 305 - (1 + 1).

2) Leave the RadGrid borders and set Width, which is equal to the RadDock width minus the left and right dock border widths and minus the RadGrid left and right border widths, e.g. 305 - (1 + 1) - (1 + 1).

By the way, I don't see why you need that <div>, you can set a pixel width directly to RadGrid.

Let us know if you need more information.

Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
CSurieux
Top achievements
Rank 2
answered on 05 Mar 2009, 11:10 AM
Hello Dimo,

Thanks it seems to work will all skins.
<div> was unecessary but as I was not sure of display mode for radgrid,so  I force it with a div in some try, keeping size instriction in div and inbox border/padding in radgrid.
I was also not sure that RadGrid would respect standard border/marin/padding block instructions.

Best regards
CS
0
CSurieux
Top achievements
Rank 2
answered on 06 Mar 2009, 09:01 AM
Hello Dimo,

Sorry but it doesn't work with skin Black for radock and Grid...
Something appears to be larger than 1px, border, padding ?????

CS
0
Dimo
Telerik team
answered on 06 Mar 2009, 09:10 AM
Hello Christian,

Yes, the Black RadDock has 2 left borders and 2 right borders, each one is 1px.

Browser tools such as Firebug or Web Developer Toolbar can be used to easily investigate such issues.

Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Dimo
Telerik team
CSurieux
Top achievements
Rank 2
Share this question
or