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

[Solved] Pager Style display as two lines

4 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gijo
Top achievements
Rank 1
Gijo asked on 11 Feb 2009, 05:38 PM
Hi,

Below is my grid. The pager displays next and prev button in one line and 'Displaying page 1 of 4, items 1 to 5 of 19.' in second line.
I would like to display all this in a single line as seen in demos and samples.

<telerik:RadGrid ID="userGrid" runat="server" GridLines="None" AutoGenerateColumns="False"
            DataSourceID="odsUsers" OnItemDataBound="userGrid_ItemDataBound" OnPreRender="userGrid_PreRender"
            Skin="None" EnableEmbeddedSkins="false" CssClass="RadGrid" 
            AllowPaging="True" PageSize="5" Width="100%" Height="100%" PagerStyle-AlwaysVisible="true">

<MasterTableView DataKeyNames="UserId" DataSourceID="odsUsers" ShowHeadersWhenNoRecords="true">
            <PagerStyle  Mode="NextPrev" Font-Size="11px" Font-Names="tahoma"  NextPageImageUrl="../img/Grid/PagingNext.gif" PrevPageImageUrl="../img/Grid/PagingPrev.gif" >
            </PagerStyle>
<Columns>
    -------
   -------
</Columns>

Thanks,
Gijo Joseph.

</MasterTableView >
</telerik:RadGrid>

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 12 Feb 2009, 08:07 AM
Hello Gijo,

You need the following styles:

.PagerLeft_None
{
     float:left;
}

.PagerRight_None
{
     float:right;
}

(Actually, setting Skin="None" makes RadGrid for ASP.NET AJAX use a skin with the name of "None" and render CSS classes for such a skin. In order to prevent all CSS classes to be rendered, you have to set Skin="", but this will make styling of RadGrid more difficult)


Kind regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Princy
Top achievements
Rank 2
answered on 12 Feb 2009, 08:55 AM
Hi,

If you are using Skin=" "  you may also  try using the code below to achieve the desired effect

CS:

  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pager = (GridPagerItem)e.Item; 
            //The grid pager contains two panels.Each of which contain a LiteralControl. The first Literal Control dispalys  the message 'Change Page with two buttons.' 
            LiteralControl ltrlControlsecondline = (LiteralControl)pager.Controls[0].Controls[1].Controls[0]; 
           //Add the literal Control of the second panel to the first panel  
            ((System.Web.UI.WebControls.Panel)(pager.Controls[0].Controls[0])).Controls.Add(ltrlControlsecondline); 
           //Hide the second panel  
            ((System.Web.UI.WebControls.Panel)(pager.Controls[0].Controls[1])).Visible = false
        } 


Thanks,
Princy
0
Gijo
Top achievements
Rank 1
answered on 12 Feb 2009, 09:28 PM
It worked . Thanks a lot.
0
sony
Top achievements
Rank 1
answered on 15 May 2009, 04:14 AM
Its not working,any other way to display pager in single line?

Tags
Grid
Asked by
Gijo
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Princy
Top achievements
Rank 2
Gijo
Top achievements
Rank 1
sony
Top achievements
Rank 1
Share this question
or