i having a rad grid with item template column consist of link button.i need to update the grid when i click the link button.
currently i am using radajaxmanger with ajax request function .but my grid doesnt get updated.
my code snippets are below
and js func is
function CloseClick(index) {
var ajaxManager = $find("<%= uxRadAjaxManager.ClientID %>");
if (ajaxManager != null)
{
ajaxManager.ajaxRequest(index);
}
and cs func are
protected void uxAlerts_OnItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
CaseAlert caseAlertDetails = e.Item.DataItem as CaseAlert;
if (caseAlertDetails != null)
{
GridDataItem dataItem = (GridDataItem)e.Item;
LinkButton rblHyperLink = (e.Item.FindControl("uxClose") as LinkButton);
string alertID = caseAlertDetails.Id.ToString();
rblHyperLink.OnClientClick = string.Format("return CloseClick('" + alertID + "');");
}
}
}
protected void uxRadAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument != null)
{
//uxAlerts.DataSource = new List<CaseAlert>();
//uxAlerts.DataBind();
}
}
When i click close link button it works and it calls ajax request but i dnt find any loading panel working on grid and no update on grid
currently i am using radajaxmanger with ajax request function .but my grid doesnt get updated.
my code snippets are below
<
telerik:RadGrid
runat
=
"server"
ID
=
"uxAlerts"
OnItemCreated
=
"uxAlerts_ItemCreated"
OnNeedDataSource
=
"uxAlerts_NeedDataSource"
OnItemDataBound
=
"uxAlerts_OnItemDataBound"
Skin
=
"Simple"
AllowPaging
=
"True"
AllowSorting
=
"True"
CellSpacing
=
"0"
GridLines
=
"Both"
CssClass
=
"Grid"
AutoGenerateColumns
=
"false"
ShowHeader
=
"true"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Subject"
HeaderText
=
"Subject"
HeaderStyle-HorizontalAlign
=
"Left"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AssignedTo"
HeaderText
=
"Assigned To"
HeaderStyle-HorizontalAlign
=
"Left"
ItemStyle-Width
=
"200px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CreatedDate"
HeaderText
=
"Date/Time"
ItemStyle-Width
=
"100px"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Action"
ItemStyle-Width
=
"100px"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"uxUnread"
runat
=
"server"
Text='<%# Bind("ReadStatus")%>'></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"uxClose"
Text
=
"Close"
runat
=
"server"
></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
Skin
=
"Default"
ID
=
"uxLoadingPanel"
/>
<
telerik:RadAjaxManager
ID
=
"uxRadAjaxManager"
runat
=
"server"
OnAjaxRequest
=
"uxRadAjaxManager_AjaxRequest"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"uxAlerts"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"uxAlerts"
LoadingPanelID
=
"uxLoadingPanel"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
function CloseClick(index) {
var ajaxManager = $find("<%= uxRadAjaxManager.ClientID %>");
if (ajaxManager != null)
{
ajaxManager.ajaxRequest(index);
}
and cs func are
protected void uxAlerts_OnItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
CaseAlert caseAlertDetails = e.Item.DataItem as CaseAlert;
if (caseAlertDetails != null)
{
GridDataItem dataItem = (GridDataItem)e.Item;
LinkButton rblHyperLink = (e.Item.FindControl("uxClose") as LinkButton);
string alertID = caseAlertDetails.Id.ToString();
rblHyperLink.OnClientClick = string.Format("return CloseClick('" + alertID + "');");
}
}
}
protected void uxRadAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument != null)
{
//uxAlerts.DataSource = new List<CaseAlert>();
//uxAlerts.DataBind();
}
}
When i click close link button it works and it calls ajax request but i dnt find any loading panel working on grid and no update on grid