Hello All,
I have Grid in the main screen, and i am having RadWindow to show popup. Our requirement is, by default, in the main screen, we are using Blank(Outline) Flag image for opening Rad Window. After closing RadWindow, we want to change the Image Url, i.e., Colored Flag Image. how can we change the Url of Image, which is in Parent Grid Without Refreshing the Parent Grid?
Please have a look at below code:
Please give suggestions, how can we change the Url of Image, which is in Parent Grid Without Refreshing the Parent Grid.
Thanks In Advance.
I have Grid in the main screen, and i am having RadWindow to show popup. Our requirement is, by default, in the main screen, we are using Blank(Outline) Flag image for opening Rad Window. After closing RadWindow, we want to change the Image Url, i.e., Colored Flag Image. how can we change the Url of Image, which is in Parent Grid Without Refreshing the Parent Grid?
Please have a look at below code:
//Grid Template Column in the Main Screen
<
telerik:GridTemplateColumn
UniqueName
=
"imgTemplateColumn"
InitializeTemplatesFirst
=
"false"
HeaderStyle-Width
=
"70"
HeaderText
=
"Image"
HeaderStyle-
SortExpression
=
"Image"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"imgbOutline"
runat
=
"server"
ImageUrl
=
"~/Images/flag_outline.png"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<%-- Declaring RadWindow Pop-up for General Data--%>
<
telerik:RadWindow
ID
=
"GeneralData"
runat
=
"server"
Title
=
"General Data"
Height
=
"650px"
Width
=
"800px"
Left
=
"150px"
ReloadOnShow
=
"true"
ShowContentDuringLoad
=
"false"
Modal
=
"true"
NavigateUrl
=
"frmMainScreen.aspx"
Behaviors
=
"Close"
>
</
telerik:RadWindow
>
// To show the GeneralData Popup
function ShowGeneralDataPopUp(id, t, rowIndex) {
var grid = $find("<%= grdProduct.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
window.radopen("popGeneralData.aspx?RecNo=" + id + "&f=" + t + "&RowIndex=" + rowIndex, "GeneralComments");
return false;
}
protected void grdProduct_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
ImageButton imgbOutline = (ImageButton)e.Item.FindControl("imgbOutline"); // Getting GeneralComments Link
imgbOutline.Attributes["href"] = "javascript:void(0);";
imgbOutline.Attributes["onclick"] = String.Format("return ShowGeneralComments('{0}','{1}', '{2}');", intRecNo, "GeneralData", e.Item.ItemIndex);
}
// After Closing the RadWindow the below Javascript method is going to call
function CloseAndRebind(args) {
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
//How can I access ImageButton of Parent Grid
//parent.document.getElementById(‘imgbOutline’)
}
Please give suggestions, how can we change the Url of Image, which is in Parent Grid Without Refreshing the Parent Grid.
Thanks In Advance.