RadAjaxManager
I have a problem to refresh my grid using RadAjaxManager from the button click of usercontrol. I have provided a very little portion of my code here. I have a grid,tab control and a refresh button. For partial post-back, I have used RadAjaxManger. When Rows are clicked on the grid, the grid is refreshed. Similarly, when refresh button is clicked grid and tabControl is partially refreshed thru AjaxManager. Till now there is no problem while performing Ajaxifying. Now i want to refresh the grid when user clicks a button in a usercontrol. I am dynamically loading different usercontrol inside tabMemberDetails_Click based on Tabs clicked. For Simplicity lets assume I have a button inside the dynamically loaded usercontrol and btnSaveClk is the event exposed from that usercontrol. I am calling btnRefresh_Click on occurence of that button click. when i debugged the code, everthing works, btnRefresh_Click is called and NeedDataSource of gvMemberList is called and the datasource shows the lates data. But the problem is the Grid doesnt show the lates data. The problem is obvious, Its just that the controls are not being refreshed because btnRefresh didnt occur by clicking on refresh button but another event called it.
I am having this problem for long time and I need to get over it very soon. Is it true that we can refresh control with the ones specified in the AjaxSettings in RadAjaxManager.Can anyone help me.
<
telerik:RadAjaxManager
ID
=
"ajaxManager"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"gvMemberList"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gvMemberList"
LoadingPanelID
=
"ajaxLoadingPanel"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnRefresh"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gvMemberList"
LoadingPanelID
=
"ajaxLoadingPanel"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"tabDetails"
LoadingPanelID
=
"ajaxLoadingPanel"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"ajaxLoadingPanel"
runat
=
"server"
Skin
=
"Default"
>
</
telerik:RadAjaxLoadingPanel
>
<
asp:ImageButton
ID
=
"btnRefresh"
ImageUrl
=
"~/Images/refresh.png"
OnClick
=
"btnRefresh_Click"
runat
=
"server"
ToolTip
=
"Refresh all list."
/>
<
telerik:RadGrid
ID
=
"gvMemberList"
runat
=
"server"
AllowPaging
=
"True"
OnInit
=
"gvMemberList_Init"
AllowCustomPaging
=
"true"
AllowSorting
=
"True"
SkinsPath
=
"RadControls/Skins"
EnableAJAX
=
"True"
OnSortCommand
=
"gvMemberList_SortCommand"
OnPageIndexChanged
=
"gvMemberList_PageIndexChanged"
OnItemDataBound
=
"gvMemberList_ItemDataBound"
OnItemCommand
=
"gvMemberList_ItemCommand"
GridLines
=
"None"
EnableEmbeddedSkins
=
"true"
PageSize
=
"10"
Visible
=
"true"
ShowStatusBar
=
"true"
LoadingTemplateTransparency
=
"45"
Width
=
"90%"
CellSpacing
=
"0"
CellPadding
=
"0"
AutoGenerateColumns
=
"false"
AllowFilteringByColumn
=
"True"
Skin
=
"WebBlue"
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
DataKeyNames
=
"EmpID"
FilterItemStyle-Width
=
"1%"
AllowFilteringByColumn
=
"true"
AllowMultiColumnSorting
=
"false"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"EmpName"
HeaderText
=
"EmployeeName"
UniqueName
=
"EmployeeName"
HeaderStyle-HorizontalAlign
=
"Center"
FilterControlWidth
=
"25px"
>
<
ItemStyle
HorizontalAlign
=
"Center"
Width
=
"1%"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Address"
HeaderText
=
"Emploee Address"
UniqueName
=
"Emploee Address"
HeaderStyle-HorizontalAlign
=
"Center"
FilterControlWidth
=
"25px"
>
<
ItemStyle
HorizontalAlign
=
"Center"
Width
=
"1%"
/>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadTabStrip
ID
=
"tabMemberDetails"
runat
=
"server"
Skin
=
"WebBlue"
MultiPageID
=
"tabDetails"
SelectedIndex
=
"0"
Align
=
"Justify"
ClickSelectedTab
=
"true"
EnableViewState
=
"false"
ReorderTabsOnSelect
=
"true"
Width
=
"1139px"
OnTabClick
=
"tabMemberDetails_Click"
ScrollChildren
=
"true"
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
ID
=
"tabDetails"
ScrollBars
=
"Auto"
runat
=
"server"
SelectedIndex
=
"0"
CssClass
=
"pageView"
Width
=
"1137px"
Height
=
"470px"
>
</
telerik:RadMultiPage
>
protected
void
tabMemberDetails_Click(
object
sender, RadTabStripEventArgs e)
{
StatusNotes control = LoadControl(
"~/Controls/StatusNotes.ascx"
)
as
StatusNotes;
control.btnSaveClk +=
new
StatusNotes.btnStatus_Click(control_btnSaveClk);
}
void
control_btnSaveClk(
object
sender, EventArgs e)
{
btnRefresh_Click(
this
,
new
ImageClickEventArgs(0,0));
}
protected
void
btnRefresh_Click(
object
sender, ImageClickEventArgs e)
{
gvMemberList.Rebind();
}
I have a problem to refresh my grid using RadAjaxManager from the button click of usercontrol. I have provided a very little portion of my code here. I have a grid,tab control and a refresh button. For partial post-back, I have used RadAjaxManger. When Rows are clicked on the grid, the grid is refreshed. Similarly, when refresh button is clicked grid and tabControl is partially refreshed thru AjaxManager. Till now there is no problem while performing Ajaxifying. Now i want to refresh the grid when user clicks a button in a usercontrol. I am dynamically loading different usercontrol inside tabMemberDetails_Click based on Tabs clicked. For Simplicity lets assume I have a button inside the dynamically loaded usercontrol and btnSaveClk is the event exposed from that usercontrol. I am calling btnRefresh_Click on occurence of that button click. when i debugged the code, everthing works, btnRefresh_Click is called and NeedDataSource of gvMemberList is called and the datasource shows the lates data. But the problem is the Grid doesnt show the lates data. The problem is obvious, Its just that the controls are not being refreshed because btnRefresh didnt occur by clicking on refresh button but another event called it.
I am having this problem for long time and I need to get over it very soon. Is it true that we can refresh control with the ones specified in the AjaxSettings in RadAjaxManager.Can anyone help me.