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

[Solved] Page size drop down list box behaves weird

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jyoti
Top achievements
Rank 1
jyoti asked on 04 May 2009, 10:18 AM
Hi,

By turning on the default pagination, I get a drop down list box for page size which contains the values 10, 20 and 50. After a couple of requests (drop down list box - page size change event), I get the records rendered correctly as per the specified page size, but the values inside the list box as if get corrupted - they show some special charaters. Also the vertical and horizontal scroll bars start appearing inside the drop down list box pull down menu.

Can you please provide me with an urgent help?

Thanks,
Jyoti

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 May 2009, 01:00 PM
Hi Jyoti,

When posting a support ticket and a forum thread about the same thing, please notify us about this.

Now to your question - we are aware of the described problem and are researching for a way to prevent it. In the meantime, please use the following workaround:

<%@ Page Language="C#" %> 
<%@ Import Namespace="System.Data" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<script runat="server"
 
    public string PageSizeComboBoxClientID; 
     
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) 
    { 
        DataTable dt = new DataTable(); 
        DataRow dr; 
        int colsNum = 5
        int rowsNum = 200
        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
    } 
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            PageSizeComboBoxClientID = (e.Item as GridPagerItem).FindControl("PageSizeComboBox").ClientID; 
        } 
    } 
 
</script> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<title>RadControls for ASP.NET AJAX</title> 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
<style type="text/css"
 
#<%= PageSizeComboBoxClientID %>_DropDown 
    overflow:hidden !important; 
 
</style> 
</telerik:RadCodeBlock> 
</head> 
<body> 
<form id="form1" runat="server"
<asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
<telerik:RadGrid 
    ID="RadGrid1" 
    runat="server" 
    AllowPaging="true" 
    OnItemCreated="RadGrid1_ItemCreated" 
    OnNeedDataSource="RadGrid1_NeedDataSource"
     
</telerik:RadGrid> 
 
</form> 
</body> 
</html> 


Regards,
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.
Tags
Grid
Asked by
jyoti
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or