How to have a RadGrid totally filling a Radock

5 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 02 Mar 2009 Link to this post

    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

     

     

     

     

     

     

     

     

     

     

  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 04 Mar 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 05 Mar 2009 Link to this post

    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
  5. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 06 Mar 2009 Link to this post

    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
  6. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 06 Mar 2009 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017