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

RadGrid Problem in Excel/PDF and Paging

3 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Farshad
Top achievements
Rank 1
Farshad asked on 13 Jun 2012, 10:37 AM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Jun 2012, 10:49 AM
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.
0
Velu
Top achievements
Rank 1
answered on 24 Nov 2014, 07:13 PM
Hi,

I have the same problem. Were you able to resolve this issue?
0
Kostadin
Telerik team
answered on 27 Nov 2014, 11:02 AM
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.

 
Tags
Grid
Asked by
Farshad
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Velu
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or