Hi friends.
I have a GridView which has linkbutton column.I Want to change the Text of this linkbutton when user click on it.But when I change the text of clicked linkbutton cell,It will be convert to the label!!!!!!!!!
What's wrong?what should I do?
THX.

Recommended Answers

All 4 Replies

You need to set CommandName and CommandArgument properties of LinkButton and handle RowCommand event of GridView.

I did it.I Access the specific cell but when I changed the Text of that cell(which is Linkbutton),Linkbutton will convert to Label!!!!!!!!!

>I did it.I Access the specific cell but when I changed the Text of that cell(which is Linkbutton),Linkbutton will convert to Label!!!!!!!!!

use FindControl method to get the reference of that linkButton.

thx for your reply.I did it too,but it returns NULL:

LinkButton L = (LinkButton)GridView1.Rows[0].Cells[0].FindControl("hypShowDetail");
L.Text="XXXX";

but L returns Null!!!!
Am I wrong?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.