<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4">
<Columns>
<asp:BoundField DataField="FileID" HeaderText="FileID" />
<asp:BoundField DataField="FilePath" HeaderText="FilePath" />
<asp:BoundField DataField="UploadedBy" HeaderText="CreatedBy" />
<asp:BoundField DataField="CreatedDate" HeaderText="CreatedDate" />
<asp:HyperLinkField HeaderText="LINK" NavigateUrl="show.aspx" Text="SHOW" />
</Columns>
conn.Open();
SqlDataReader rdr = comm.ExecuteReader();
if (NAME.Equals("admin"))
{
GridView1.DataSource = rdr;
GridView1.DataBind();
}
else
{
GridView2.DataSource = rdr;
GridView2.DataBind();
}
rdr.Close();
I want to use the hyperlink in the Gridview to pass the values dynamically according to to the row it is clicked.As I’m new to this I’m not able to do that.Please anybody help me.
add onRowCommand Event in your grid
Then define link Button with the CommandName and CommandArgument
and than on code behind
Hope this will help you.