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

user's work effects when notification arrives.

1 Answer 46 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Zeeshan
Top achievements
Rank 1
Zeeshan asked on 10 May 2014, 11:24 PM
Hello,

I have implemented RadNotification control in my webproject. and on certain time interval the user gets the notification of alerts. now the problem which i am facing is that when the user is filling the webform and at that time the notification popups up the user focus lost from the form. Autocomplete stops, dropdowns closes.

What i want is that user's work not effects when the notification arrives.

Awaiting for your quick response.

Regards,
Zeeshan Saeed

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 May 2014, 06:54 AM
Hi Zeeshan,

Please have a look into the sample code snippet which works fine at my end. Please provide your code if it doesn't help.

ASPX:
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="SqlDataSource1"
    DataTextField="OrderID">
</telerik:RadAutoCompleteBox>
<telerik:RadDropDownList ID="RadDropDownList1" runat="server" DataSourceID="SqlDataSource1"
    DataTextField="OrderID">
</telerik:RadDropDownList>
<telerik:RadNotification ID="RadNotification1" runat="server" LoadContentOn="TimeInterval"
    Width="300" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true"
    OnClientUpdated="OnClientUpdated" Title="Received messages" OffsetX="-20" OffsetY="-20"
    TitleIcon="none" UpdateInterval="3000" AutoCloseDelay="1500" OnCallbackUpdate="OnCallbackUpdate">
    <ContentTemplate>
        <asp:Literal ID="lbl" runat="server"></asp:Literal>
    </ContentTemplate>
</telerik:RadNotification>

JavaScript:
function OnClientUpdated(sender, args) {
    var message = "Update (check) was done!";
    var newMsgs = sender.get_value();
    if (newMsgs != 0) {
        sender.show();
        message += (newMsgs == 1) ? (" There is 1 new message!") : (" There are " + newMsgs + " new messages!");
    }
    else {
        message += " There are no new messages!";
    }
}

C#:
protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e)
{
    int newMsgs = DateTime.Now.Second % 10;
    if (newMsgs == 5 || newMsgs == 7 || newMsgs == 8 || newMsgs == 9) newMsgs = 0;
    lbl.Text = String.Concat(new object[] { "You have ", newMsgs, " new messages!" });
    RadNotification1.Value = newMsgs.ToString();
}

Thanks,
Shinu.
Tags
Notification
Asked by
Zeeshan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or