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

Pager Style in Radgrid

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sandeep
Top achievements
Rank 1
sandeep asked on 22 Aug 2014, 08:31 AM
Please observe the snapshot 
The numbers in pager style are jumping downwards and upwards when i place mouse pointer over it,not able to find out what the issue is,can any help me..

 RadGrid1.PagerStyle.Position = GridPagerPosition.TopAndBottom;
 RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
 RadGrid1.PagerStyle.PagerTextFormat = "{4} Page {0} from {1}, rows {2} to {3} from {5}";
 RadGrid1.PagerStyle.PageSizeLabelText = "Results per page";

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 22 Aug 2014, 09:26 AM
Hi Sandeep,

I was not able to replicate such an issue at my end. The provided information is not enough to replicate the issue. Please try the below sample code snippet, check if you can replicate it. Provide your full code snippet, version and browser details for further help.

ASPX:
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

C#:
RadGrid rgrdSample;   
protected void Page_Init(object source, System.EventArgs e)
{
    rgrdSample = new RadGrid();
    rgrdSample.ID = "rgrdSample";     
    rgrdSample.AllowPaging = true;
    rgrdSample.AllowSorting = true;      
    rgrdSample.AutoGenerateColumns = false;
 
    rgrdSample.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
    rgrdSample.PagerStyle.Position = GridPagerPosition.TopAndBottom;       
    rgrdSample.PagerStyle.PagerTextFormat = "{4} Page {0} from {1}, rows {2} to {3} from {5}";
    rgrdSample.PagerStyle.PageSizeLabelText = "Results per page";
 
    rgrdSample.MasterTableView.DataKeyNames = new string[] { "OrderID" };
    rgrdSample.NeedDataSource += new GridNeedDataSourceEventHandler(rgrdSample_NeedDataSource);
 
    GridBoundColumn boundColumnID;
    boundColumnID = new GridBoundColumn();
    boundColumnID.DataField = "OrderID";
    boundColumnID.HeaderText = "OrderID";
    boundColumnID.SortExpression = "OrderID";
    rgrdSample.MasterTableView.Columns.Add(boundColumnID);
 
    GridBoundColumn boundColumnCity;
    boundColumnCity = new GridBoundColumn();
    boundColumnCity.DataField = "ShipCity";
    boundColumnCity.HeaderText = "ShipCity";
    boundColumnCity.SortExpression = "ShipCity";
    rgrdSample.MasterTableView.Columns.Add(boundColumnCity);
    this.PlaceHolder1.Controls.Add(rgrdSample);
}
 
void rgrdSample_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    rgrdSample.DataSource = GetDataTable("SELECT * FROM Orders");
}  
 
public DataTable GetDataTable(string query)
{
    String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
    SqlConnection conn = new SqlConnection(ConnString);
    SqlDataAdapter adapter = new SqlDataAdapter();
    adapter.SelectCommand = new SqlCommand(query, conn);
 
    DataTable myDataTable = new DataTable();
 
    conn.Open();
    try
    {
        adapter.Fill(myDataTable);
    }
    finally
    {
        conn.Close();
    }
 
    return myDataTable;
}

Thanks,
Princy
Tags
Grid
Asked by
sandeep
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or