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

popup in RADGrid

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manikandan
Top achievements
Rank 1
Manikandan asked on 01 Nov 2008, 11:57 AM
Hello,

I am using RadGrid control,used to display the emp name,age,city and employee photo,  In the grid view, make the photo name a clickable hyperlink that pops the employee image to a new window.

please advise how to open the new window in the RADGrid.

Thanks & Regards
Mani

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Nov 2008, 05:54 AM
Hi,

You can use a GridTemplateColumn to achieve the desired scenario. Place a HyperLink control in the ItemTemplate of a template column. Access the hyperlink in the code behind and add an onclick attribute to the hyperlink. Open the Window  in the client side click event of the Hyperlink.

CS:
 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            HyperLink photoLink = (HyperLink)e.Item.FindControl("photoLink"); 
            photoLink.Attributes.Add("Onclick", " return ShowImage();"); 
        } 
  } 

JS:
 
<script type="text/javascript">  
  function ShowImage()  
  {  
   window.radopen("EmployeePhoto.aspx", "RadWindow1");  
  }  
</script>  
 


You can also refer the following online demo which demonstrates a similar scenario.
Window Editing


Regards
Shinu.
Tags
Grid
Asked by
Manikandan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or