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

GridTemplateColumn LinkButton - turn off loading panel

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Philip Senechal
Top achievements
Rank 1
Philip Senechal asked on 19 Jan 2011, 11:34 PM
I have a pretty simple request, I just can't seem to figure out how to do it =)

I have an AJAXified grid with a GridTemplateColumn defined as follows

<telerik:GridTemplateColumn HeaderText="Request #" DataField="ReqNm" UniqueName="ReqNm"
    Groupable="false" SortExpression="ReqID" AllowFiltering="true" HeaderStyle-Wrap="false"
    ItemStyle-Wrap="false">
    <ItemTemplate>
        <asp:LinkButton ID="btn_ReqID" Text='<%# Eval("ReqID") %>' OnClick="btn_ReqID_Click"
            CommandArgument='<%# Eval("ReqID") %>' runat="server" />
        <br />
        <asp:Label ID="lbl_ReqNm" Text='<%# Eval("ReqNm") %>' runat="server" />
    </ItemTemplate>
    <FilterTemplate>
        <telerik:RadComboBox ID="dd_type_filter" Skin="Default" Width="120px" Font-Size="11px"
            MarkFirstMatch="true" AppendDataBoundItems="true" SelectedValue='<%# (Container as GridItem).OwnerTableView.GetColumn("ReqNm").CurrentFilterValue %>'
            OnClientSelectedIndexChanged="TypeIndexChanged" runat="server">
            <Items>
                <telerik:RadComboBoxItem Text="All" />
            </Items>
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function TypeIndexChanged(sender, args) {
                    var tableView = $find("<%# (Container as GridItem).OwnerTableView.ClientID %>");
                    tableView.filter("ReqNm", args.get_item().get_value(), "EqualTo");
                }
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>
</telerik:GridTemplateColumn>

In the ItemTemplate, there is a LinkButton that executes the code below:

protected void btn_ReqID_Click(object sender, EventArgs e)
{
    LinkButton btn_ReqID = (LinkButton)sender;
 
    Session["s_ReqID"] = int.Parse(btn_ReqID.CommandArgument.ToString());
 
    string url = "~/eis/request/";
    var AjaxManager = RadAjaxManager.GetCurrent(this.Page);
    AjaxManager.Redirect(url);
}

This is in Sitefinity, so I have to use the AjaxManager to redirect or I get a funky URL. When I click on the LinkButton, I get the LoadingPanel displaying in the center of the grid, then it disappears and the page redirects.

What I'd like to do is to disable the LoadingPanel when these LinkButtons are clicked so that it just redirects like a normal page click.

I have to keep Ajax enabled on the grid though because there are other grid functions that require having Ajax.

Is there a way in the LinkButton click event or in the Grid's ItemDataBound event that I can turn off the loading panel for these LinkButtons?

Thanks =)

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Jan 2011, 12:55 PM
Hello Philip,

Here's a help document on how to conditionaly display loading panel over updated control:
Show and hide loading panel explicitly

Hope this helps,
Princy.
Tags
Grid
Asked by
Philip Senechal
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or