Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hw to open a popup window onclickin the link button column of the gridview...
de pop up contains additional information for the specific row,so on clickin the button of a row,onli tht row's additional info shud be displayed in the pop up
hw to achieve dis using vb

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 13-Apr-12 23:15pm
v2
Comments
OriginalGriff 14-Apr-12 5:16am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

Hi,
You need to add onclick handler to your buttons on the grid during RowCreated on the grid:

C#
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        Button b = e.Row.FindControl("btn");
        string IdValue =  //Write code to find your id in the e.Row.DataItem
        b.Attributes.Add("onclick", string.Format("window.open('PageName.aspx?RecId={0}')", IdValue));
    }
}


I hope it helps,
Cheers
 
Share this answer
 
Comments
Torakami 7-Sep-13 4:27am    
How can i do same for MouseOver. I want to open model popup on Mouseover on Gridviews Link Button
Reza Ahmadi 7-Sep-13 5:51am    
have you tried replacing "onclick" with "onmouseover" ?
Torakami 7-Sep-13 6:11am    
ok you mean shall i add onclick for linkbutton ?? and where i need to show model popup .. i mean where should i call modelpopup.shpw method ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900