Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a datagridview with hyperlink column. i want to open a modal pop up when uer clicks of the hyperlink. I also want to load the controls in the modal pop up with values in the grid row .

here is teh current code:
XML
<script type="text/javascript">
    function Edit() {
       document.getElementById('<%=btnEdit.ClientID%>').click();
       }
</script>


<asp:HyperLink ID = "hpUserAlias" Width="100%" runat="server" Text='<%# Bind("UserAlias") %>' Font-Underline = "true" ForeColor = "Blue" onclick = "Edit();" >

C#
protected void btnEdit_Click(object sender, EventArgs e)
       {GridViewRow row;
            row = grdUsers.SelectedRow;
}

I am getting a null value in the SelectedRow property.

Can anyone help please?

Thanks.
Ann.
Posted
Updated 28-Jul-11 20:17pm
v2

1 solution

Hpe this helps as this is what i used :)

SQL
if (dataGridView1.SelectedRows.Count > 0)
{
    DataGridViewSelectedRow currentRow = dataGridView1.SelectedRows[0];
}
 
Share this answer
 

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