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

[Solved] Loading Panel and Webservice Client Side DataBinding

2 Answers 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nono
Top achievements
Rank 1
nono asked on 06 Jan 2010, 07:40 AM
Below is my code, the two problems I have is the loading panel never shows up while binding,
the second is the grid shows 11 empty rows untill it finishes binding to the Webservice this
is based on the page size i do believe even though I am not using pageing. It also does not
render the images past the 11th row


<
telerik:RadScriptBlock ID="rsb" runat="server">  
   <script type="text/javascript">  
function NavRowClick(sender, eventArgs)  
{  
    window.location.href = "<%= Request.ApplicationPath %>/" + eventArgs.getDataKeyValue("URL")  
}  
function NavRowDataBound(sender, eventArgs)  
{  
    if (("<%= Request.ApplicationPath %>/" + eventArgs.get_dataItem().URL) == document.location.pathname)  
    {  
        eventArgs.get_item().addCssClass("navSelected");  
    }  
}  
   </script> 
</telerik:RadScriptBlock> 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="rg_n">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="rg_n" LoadingPanelID="rlp" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                    </AjaxSettings> 
                    </telerik:RadAjaxManager> 
<telerik:RadAjaxLoadingPanel runat="server" ID="rlp" /> 
<telerik:RadGrid ID="rg_n" runat="server" ShowHeader="false" CssClass="n" AlternatingItemStyle-CssClass="nav" ItemStyle-CssClass="nav" AutoGenerateColumns="false" AllowPaging=false>  
    <ClientSettings ClientEvents-OnRowClick="NavRowClick" ClientEvents-OnRowDataBound="NavRowDataBound" > 
        <DataBinding Location="~/main.asmx" SelectMethod="GetNavigation" EnableCaching="true" /> 
    </ClientSettings> 
    <MasterTableView ClientDataKeyNames="URL">  
        <NoRecordsTemplate>No Menu Items</NoRecordsTemplate> 
        <Columns> 
            <telerik:GridImageColumn DataImageUrlFields="ImageURL" DataImageUrlFormatString="~/MasterPages/images/{0}" DataType="System.String" DataAlternateTextField="Name" ImageHeight="16" ImageWidth="16" ItemStyle-Width="16" ItemStyle-Height="16"></telerik:GridImageColumn> 
            <telerik:GridBoundColumn DataField="Name" ItemStyle-HorizontalAlign="Left" ></telerik:GridBoundColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

2 Answers, 1 is accepted

Sort by
0
nono
Top achievements
Rank 1
answered on 07 Jan 2010, 07:56 AM
anyone got any ideas? plz.
0
Iana Tsolova
Telerik team
answered on 07 Jan 2010, 09:31 AM
Hi nono,

Please check out how the loading panel could be displayed over a client-side bound grid in this online demo. Note that the loading panel is ment to be displayed during an ajax request, and as the grid is bound on the client no such request is invoked. Therefore you need to show/hide the loading panel manually.

To overcome the second issue, try setting the grid page size to the number of the records in its datasource.

Try it out and let me know if any issues arise. 

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
nono
Top achievements
Rank 1
Answers by
nono
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or