开发者

Show loading image while radgrid load with data

开发者 https://www.devze.com 2023-03-23 12:19 出处:网络
I\'m using radgrid in my asp.net application. In button 开发者_运维百科click i\'m binding the grid with data.

I'm using radgrid in my asp.net application. In button 开发者_运维百科click i'm binding the grid with data. But its takes some times to bind data. So I want to show the load image till finish databinding. How to show the loding image while radgrid loding with data. Please help me.


<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page,
     "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' />
</telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnRefresh">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlAlerts" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>


I think your code has the right idea to use RadAjaxManager to accomplish this. Is it safe to assume that your grid is found inside of pnlAlerts? If not, be sure to include your grid as an updated control. I also usually add a clause that the grid itself will trigger an ajax call (if for instance the user is filter, moving columns, etc). For example:

<telerik:AjaxSetting AjaxControlID="Grid1">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="Grid1" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
</telerik:AjaxSetting>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号