RadGrid Problem in Excel/PDF and Paging

4 posts, 0 answers
  1. Farshad
    Farshad avatar
    6 posts
    Member since:
    Feb 2012

    Posted 13 Jun 2012 Link to this post

    Hi everyone,
    Please response to Kassaiefarshad@yahoo.com

    I have used RadGrid in a Webpart in Sharepoint 2010. I am not using Ajax.

    I have got two problem as follow:
    Problem 1:

    When I enable Paging in RadGrid it doesn't work.It mean that when I click on page "2" to go to page two, it returns empty page.

    My webpart's code is as follow:
            <telerik:RadGrid ID="RadGridArzyabiDavari" runat="server" AllowPaging="True"
                AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0"
                GridLines="None">
    <ClientSettings>
    <Selecting CellSelectionMode="None"></Selecting>
    </ClientSettings>
     
    <MasterTableView AllowSorting="False" NoMasterRecordsText="موردی برای نمایش یافت نشد"
                    CommandItemDisplay="Bottom" PageSize="5">
    <CommandItemSettings ExportToPdfText="PDF خروجی" ExportToExcelText="Excel خروجی" ShowAddNewRecordButton="false"
      ShowExportToExcelButton="true" ShowExportToPdfButton="true"></CommandItemSettings>
     
    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
     
    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
     
        <Columns>
            <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <img height="100px"
        src='http://kms/MembersPictures/<;%#Eval("Expert")%>.jpg' style="border: 0px;"
        width="75px" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="ExpertDisplayName "
                FilterControlAltText="Filter ExpertDisplayName column" HeaderText="نام کاربری"
                SortExpression="ExpertDisplayName " UniqueName="ExpertDisplayName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TedadDavari "
                FilterControlAltText="Filter TedadDavari column" HeaderText="تعداد داوری ها"
                SortExpression="TedadDavari " UniqueName="TedadDavari">
            </telerik:GridBoundColumn>
        </Columns>
     
    <EditFormSettings>
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
        <PagerStyle AlwaysVisible="True" />
    </MasterTableView>
    <ExportSettings FileName="KMSFile" IgnorePaging="true" OpenInNewWindow="true">
                    <Pdf Author="سیستم مدیریت دانش" Creator="گروه مشاورین هوژان"
                        PageHeight="297mm" PageWidth="210mm" PaperSize="A4" />
    </ExportSettings>
     
    <FilterMenu EnableImageSprites="False"></FilterMenu>
            </telerik:RadGrid>
     
    Code Behind is as follow:
     
            protected void Page_Load(object sender, EventArgs e)
            {
                     List<ReportsDataSources.ArzyabiDavari> arzyabidavari = new List<ReportsDataSources.ArzyabiDavari>();
                if (!Page.IsPostBack)
                {
                    Bind_RadGridArzyabiDavari();
                    RadGridArzyabiDavari.DataSource = arzyabidavari;
                    RadGridArzyabiDavari.DataBind();
                }
            }
    Problem 2:

    when I enable Paging in RadGrid ,then click on Export to Pdf/Excel button it returns an Error as follow:

    --------------------------------------------------------------------------------
     
    Script control 'PageSizeComboBox' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
    Parameter name: scriptControl
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jun 2012 Link to this post

    Hello Farshad,

    I cannot reproduce the error at my end. Please elaborate a bit more on this.
    The grid returns an empty page because you are using simple data binding. In order to use advanced features in grid, make sure that you are using advanced data binding using its NeedDataSource event. Check the following help documentation which explains the same.
    Advanced Data-binding (using NeedDataSource event)

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Velu
    Velu avatar
    4 posts
    Member since:
    Jun 2013

    Posted 24 Nov 2014 in reply to Farshad Link to this post

    Hi,

    I have the same problem. Were you able to resolve this issue?
  5. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 27 Nov 2014 Link to this post

    Hi Velu,

    Could you please verify that you are using an advanced data biding? Note that using of this type of binding should fix the issue with the paging. Regards the issue with exporting the grid to PDF could you please elaborate a little bit more.

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top