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

RadGrid display bug?

3 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ales Savli
Top achievements
Rank 1
Ales Savli asked on 16 Jul 2010, 01:46 PM
Hello!

I have 2 problems with displaying RadGrid.

I have attached a picture displaying it.

First problem (RED square): Every time there is a vertical scroll displayed we get this strange white space. Any idea how to fix this?

Second problem (BLUE square) apears when client side colum resizing is possible. We think that the last column should always be connected with the right side of the grid just like the fist one is connected with the left side.

Thanks for your help!

Ales

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 Jul 2010, 09:34 AM
Hello Ales,

When RadGrid scrolling is enabled, the right end of the last column does not necessarily touch the right end of the RadGrid - it may be on the left or on the right.

As for the top-right white-space - you can remove it by applying the header cells' background image to the control's outer <div> wrapper. Here is a simple demo. This solution is not universal for all scenarios, that's why we can't include it out-of-the-box. You may need to adjust the image's vertical position (-8050px) depending on whether you are using a top CommandItem or pager.


<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<script runat="server">
  
protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable dt = new DataTable();
    DataRow dr;
    int colsNum = 4;
    int rowsNum = 10;
    string colName = "Column";
  
    for (int j = 1; j <= colsNum; j++)
    {
        dt.Columns.Add(String.Format("{0}{1}", colName, j));
    }
  
    for (int i = 1; i <= rowsNum; i++)
    {
        dr = dt.NewRow();
  
        for (int k = 1; k <= colsNum; k++)
        {
            dr[String.Format("{0}{1}", colName, k)] = String.Format("{0}{1} Row{2}", colName, k, i);
        }
        dt.Rows.Add(dr);
    }
  
    (sender as RadGrid).DataSource = dt;
}
  
      
</script>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  
<head id="Head1" runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls</title>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<style type="text/css">
  
div.RadGrid_Office2007
{
    background:0 -8050px repeat-x url('<%= Page.ClientScript.GetWebResourceUrl(typeof(RadGrid), "Telerik.Web.UI.Skins.Office2007.Grid.sprite.gif")%>');
}
  
</style>
</telerik:RadCodeBlock>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
  
<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    Width="800px"
    Skin="Office2007"
    OnNeedDataSource="RadGrid_NeedDataSource">
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="200px" />
    </ClientSettings>
</telerik:RadGrid>
  
</form>
</body>
</html>


Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ales Savli
Top achievements
Rank 1
answered on 19 Jul 2010, 11:03 AM
Thanks for your reply. I'll take a look at your demo.

About the other problem. Is it posible to get rid of that nasty looking right end of the columns (the middle line)?

Thanks.
0
Dimo
Telerik team
answered on 19 Jul 2010, 12:05 PM
Hello Ales,

Yes, in your case I recommend you to set CssClass="rgNoScrollImage" to RadGrid. This will remove the background image, which is designed to align well only if the header row is single-lined.

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Ales Savli
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Ales Savli
Top achievements
Rank 1
Share this question
or