Hello,
I am using RadNotification control with RadGrid which is inside contentTemplate of it. I am generating RadNotification in some interval (i.e. using javascript function setInterval) with respect to condition. I am binding Radgrid in OnRadAjaxRequest Event.
Issue: Radgrid is not refreshing during every interval.
Below code is listes in Master Page
Javascript
Master.aspx
Master.aspx.cs
I am using RadNotification control with RadGrid which is inside contentTemplate of it. I am generating RadNotification in some interval (i.e. using javascript function setInterval) with respect to condition. I am binding Radgrid in OnRadAjaxRequest Event.
Issue: Radgrid is not refreshing during every interval.
Below code is listes in Master Page
Javascript
setInterval(function () { $find("<%= RamMaster.ClientID %>").ajaxRequest("Reminder"); }, 10000);
Master.aspx
<
div
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
border
=
"0"
>
<
tr
>
<
td
>
<
telerik:RadNotification
ID
=
"n1"
runat
=
"server"
Text
=
"Initial text"
Position
=
"Center"
Style
=
"z-index: 0"
AutoCloseDelay
=
"0"
Width
=
"700px"
Title
=
"Reminder"
>
<
ContentTemplate
>
<
table
width
=
"100%"
cellpadding
=
"0"
cellspacing
=
"0"
border
=
"0"
>
<
tr
>
<
td
align
=
"right"
>
<
span
style
=
"color: Red"
>*</
span
><
strong
>Move the mouse over a Message to see more details</
strong
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadAjaxPanel
ID
=
"rap"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"gvReminder"
runat
=
"server"
Width
=
"100%"
AutoGenerateColumns
=
"false"
PageSize
=
"10"
ShowStatusBar
=
"true"
ClientIDMode
=
"AutoID"
AllowPaging
=
"true"
AllowSorting
=
"false"
Skin
=
"Office2007"
OnNeedDataSource
=
"gvReminder_NeedDataSource"
>
<
MasterTableView
DataKeyNames
=
"ReminderID"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ReminderID"
Visible
=
"false"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"Message"
HeaderStyle-Font-Bold
=
"true"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"targetControl"
runat
=
"server"
Text='<%#TextLimitString(Eval("Message").ToString()) %>'></
asp:HyperLink
>
<
telerik:RadToolTip
ID
=
"tltRttip"
runat
=
"server"
TargetControlID
=
"targetControl"
AutoCloseDelay
=
"0"
ShowEvent
=
"OnMouseOver"
Skin
=
"Office2007"
>
<
div
>
<
div
style
=
"margin: 0 auto; text-align: center"
>
New Note From <
b
>
<%# GetUserName(Eval("CreatedBy").ToString()) %></
b
></
div
>
<
br
/>
<
div
style
=
"float: left; width: 100px"
>
<
b
>Patient Name:</
b
></
div
>
<
div
>
<%#Eval("PatName")%>
</
div
>
<
br
/>
<
div
style
=
"float: left; width: 100px"
>
<
b
>Message:</
b
></
div
>
<
div
>
<%#Eval("Message") %></
div
>
</
div
>
</
telerik:RadToolTip
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
HeaderStyle-Font-Bold
=
"true"
HeaderText
=
"Snooze"
>
<
ItemTemplate
>
<
telerik:RadComboBox
ID
=
"RcbSnooze"
runat
=
"server"
Style
=
"z-index: 100000"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"1 Min"
Value
=
"1"
Selected
=
"true"
/>
<
telerik:RadComboBoxItem
Text
=
"5 Min"
Value
=
"5"
/>
<
telerik:RadComboBoxItem
Text
=
"10 Min"
Value
=
"10"
/>
<
telerik:RadComboBoxItem
Text
=
"20 Min"
Value
=
"20"
/>
<
telerik:RadComboBoxItem
Text
=
"30 Min"
Value
=
"30"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadButton
ID
=
"btnSnooze"
runat
=
"server"
Text
=
"Snooze"
OnClick
=
"btnID_Click"
CommandName='<%# Eval("ReminderID") %>' CommandArgument="False" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
ItemStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
telerik:RadButton
ID
=
"btnID"
runat
=
"server"
Text
=
"Dismiss"
OnClick
=
"btnID_Click"
CommandName='<%# Eval("ReminderID") %>' CommandArgument="True" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
telerik:RadAjaxPanel
>
</
td
>
</
tr
>
</
table
>
</
ContentTemplate
>
<
NotificationMenu
ID
=
"TitleMenu"
>
</
NotificationMenu
>
</
telerik:RadNotification
>
</
td
>
</
tr
>
</
table
>
</
div
>
Master.aspx.cs
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
try
{
dt = new DataTable();
if (e.Argument == "Reminder")
{
CurUsr = 14;
_objPD.FillReminderList(CurUsr, gvReminder);
gvReminder.DataBind();
if (gvReminder.Items.Count > 0)
{
n1.Show();
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
}
}