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

[Solved] Pager Control Squished

4 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 12 Feb 2010, 04:01 PM

The pager control on the bottom of the grid shows with the first, prev on one line, pages on a second line, next, last on a third line, page size on a 4th line and item count/numb pages on the 5th line.

I have played with the wrap function, mode, etc of the pager and haven't had any significant changes, none good at least. I can change the text for he pager size and have it reflect so the changes are working. The grid is created in code and added to a placeholder control.

Below is the code above all the columns and the add to place holder, but it is the area where all the formatting is set.

Hopefully you can tell me what when wrong. The problem came up with I upgraded the website, so it had something to do with the changes. I am currently on 2009.3.1314.35

Thanks for your help
Randy Miller

gvReceipts.BorderStyle = BorderStyle.Solid

gvReceipts.BorderWidth = 1

gvReceipts.CellPadding = 3

'gvReceipts.Font.Size = 3

 

 

gvReceipts.ForeColor = Drawing.Color.Black

gvReceipts.GridLines = GridLines.Vertical

gvReceipts.AllowPaging = True

 

 

gvReceipts.AllowSorting = True

 

 

gvReceipts.AutoGenerateColumns = False

 

 

gvReceipts.Height = 415

gvReceipts.Width = 1350 ' Unit.Percentage(100)

 

 

gvReceipts

gvReceipts.FooterStyle.Width = gvReceipts.Width

gvReceipts.FooterStyle.Wrap = False

 

 

'gvReceipts.PagerStyle.Mode = GridPagerMode.Slider

 

 

gvReceipts.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric

'gvReceipts.PagerStyle.

 

 

gvReceipts.Skin = ""

 

 

gvReceipts.PagerStyle.Width = gvReceipts.Width

gvReceipts.MasterTableView.PagerStyle.Width = gvReceipts.Width

gvReceipts.PagerStyle.Wrap = False

 

 

gvReceipts.MasterTableView.PagerStyle.Wrap = gvReceipts.PagerStyle.Wrap

'gvReceipts.Skin = "Default"

 

 

gvReceipts.PageSize = 15

gvReceipts.GroupingEnabled = True

 

 

gvReceipts.ShowGroupPanel = True

 

 

gvReceipts.ClientSettings.AllowDragToGroup = True

 

 

'gvReceipts.HeaderStyle.BackColor = Drawing.ColorTranslator.FromHtml("#711000")

 

 

gvReceipts.HeaderStyle.Font.Bold = True

 

 

'gvReceipts.HeaderStyle.ForeColor = Drawing.ColorTranslator.FromHtml("#DDAA22")

 

 

'gvReceipts.HeaderStyle.BorderColor = Drawing.ColorTranslator.FromHtml("#711000")

 

 

gvReceipts.HeaderStyle.BorderStyle = BorderStyle.None

'gvReceipts.FooterStyle.BackColor = Drawing.ColorTranslator.FromHtml("#CCCCCC")

 

 

'gvReceipts.MasterTableView.DataMember = "Customers"

 

 

''gvReceipts.MasterTableView.PageSize = 15

 

 

gvReceipts.MasterTableView.AlternatingItemStyle.BackColor = Drawing.ColorTranslator.FromHtml("#6699FF")

gvReceipts.MasterTableView.AlternatingItemStyle.Wrap = False

 

 

RefreshData()

gvReceipts.MasterTableView.DataKeyNames = New String() {"rtn_pnref", "clientid"}

Dim colNewColumn As GridBoundColumn

Dim colNewButtonColumn As GridButtonColumn = New GridButtonColumn

colNewButtonColumn.ButtonType = GridButtonColumnType.ImageButton

colNewButtonColumn.HeaderText = "Select"

 

 

colNewButtonColumn.ImageUrl = "~/ClientServices/insurance/images/print.gif"

 

 

colNewButtonColumn.CommandName = "print"

 

 

colNewButtonColumn.AutoPostBackOnFilter = "True"

 

 

colNewButtonColumn.UniqueName = "colSelect"

 

 

colNewButtonColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center

gvReceipts.MasterTableView.Columns.Add(colNewButtonColumn)

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 Feb 2010, 09:31 AM
Hi Randy,

The RadGrid pager layout depends on some CSS styles, which are not applied if you are using the control without a skin. However, you can restore the single-line pager layout by using a custom CSS class:

<%@ 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 = 30;
        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 runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls</title>
<style type="text/css">
 
.NoSkinPager div{display:inline}
 
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
 
<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    AllowPaging="true"
    Skin=""
    OnNeedDataSource="RadGrid_NeedDataSource">
    <PagerStyle CssClass="NoSkinPager" />
</telerik:RadGrid>
 
 
</form>
</body>
</html>


All the best,
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
Randy
Top achievements
Rank 1
answered on 16 Feb 2010, 02:41 PM
Thanks for the response.

That is making a little sense now. I acutally am using skins, but I am doing it through a theme and a skin file. I checked my css and

.NoSkinPager div{display:inline}


display or inline isn't in the Grid's CSS file. I suspect that the base CSS file that I found 2 years ago or so is missing some of the newer tags. I created the CSS files and themes before you want to the embeded skins. Where can I find the base css file now? All of the changes I made is in one of two files so I would like to replace your files with current versions. Is there someplace I can find them?

Thanks
Randy Miller
TransGuardian
0
Dimo
Telerik team
answered on 17 Feb 2010, 12:05 PM
Hi Randy,

I am sending you a CSS file, which contains all the styles that RadGrid needs, no matter which skin is being used.

All the best,
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
Randy
Top achievements
Rank 1
answered on 23 Feb 2010, 12:39 PM
Thank You, that took care of the problem.

Randy
Tags
Grid
Asked by
Randy
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Randy
Top achievements
Rank 1
Share this question
or