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

Notification Not Showing Properly when .Show from Grid Item Command

1 Answer 122 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Robot B9
Top achievements
Rank 2
Robot B9 asked on 25 Jul 2012, 01:54 PM
Using latest(2012, 2, 607, 40) version I have one notification control on the page.
In code, I can set and show the notification and it shows fine.
But when I set and show the notification from the ItemCommand in a raggrid, then notifiaction shows no text in the title or text; It still has the notification popup with Icon, and that's it......

<

asp:Content ID="Content1" ContentPlaceHolderID="cp" runat="Server">

    <telerik:RadAjaxManager runat="server" ID="ram" DefaultLoadingPanelID="rlp">

        <AjaxSettings>

            <telerik:AjaxSetting AjaxControlID="btnNew">

                <UpdatedControls>

                    <telerik:AjaxUpdatedControl ControlID="rgvPolicy" />

                </UpdatedControls>

            </telerik:AjaxSetting>

            <telerik:AjaxSetting AjaxControlID="rgvPolicy">

                <UpdatedControls>

                    <telerik:AjaxUpdatedControl ControlID="rgvPolicy" />

                </UpdatedControls>

            </telerik:AjaxSetting>

        </AjaxSettings>

    </telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel runat="server" ID="rlp">

</telerik:RadAjaxLoadingPanel>

<telerik:RadNotification AutoCloseDelay="0" Animation="Resize" AnimationDuration="500" runat="server" ID="rn" Position="Center" Width="400" />

<div class="generic-container" style="margin:10px;"> ...

 

 

Protected Sub rgvPolicy_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgvPolicy.ItemCommand

    If TypeOf e.Item Is GridDataItem And e.CommandName = "Delete" Then

        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

        Dim ID = DirectCast(item.GetDataKeyValue("PolID"), Integer)

        Dim desc = item("PolDescription").Text
 

        proj.espManager(schema).PolicyManager.Item(ID).Delete()

        rgvPolicy.Rebind()

 

        With rn

            .TitleIcon = IconURL(Buttons.ButtonFunction.Ok)

            .Title = "Policy Deleted"

            .Text = String.Format("Policy '{0}' and all its calculations have been deleted.", desc)

            .Show()

        End With

    End If

End Sub

Protected Sub RadButtonEx1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButtonEx1.Click

    With rn

        .TitleIcon = IconURL(Buttons.ButtonFunction.Ok)

        .Title = "AAAAAAAAAAAAAARG"

        .Text = String.Format("Policy '{0}' and all its calculations have been deleted.", "YADDA")

        .Show()

    End With  

End Sub

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Jul 2012, 01:49 PM
Hi Mark,

This behavior stems from the way you have configured your AJAX settings - you need to update the RadNotification when the RadGrid is the postback initiator in order for the new properties to transfer to the client and this is the general way AJAX works - when a server property is changed during a partial postback you also need to update the control on the client.

In this case you would need the following AJAX setting:
<telerik:AjaxSetting AjaxControlID="rgvPolicy">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="rgvPolicy" />
        <telerik:AjaxUpdatedControl ControlID="rn" />
    </UpdatedControls>
</telerik:AjaxSetting>



All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Notification
Asked by
Robot B9
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or