Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text property in a hyperlinkfield returning null

Status
Not open for further replies.

flyclassic22

Technical User
Oct 1, 2002
54
SG
I've a gridview which has
Hyperlinkfield in Second Column,
I'm trying to access the text property, but its returning null

protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = ((GridView)e.CommandSource).Rows[index];
if (e.CommandName == "AddtoCart") {

Response.Write(selectedRow.Cells[1].Text.ToString());
}

if i'm access from a Boundfield, it will not return a null, how do i solve this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top