Answered by:
gridview and C#

Question
-
i have my gridview and i want each item in the gridview clickable and each item navigate to another different page
- Moved by CoolDadTx Thursday, December 3, 2015 3:14 PM Wrong forums
Thursday, December 3, 2015 11:58 AM
Answers
-
You are talking Web UI controls, which are discussed at the ASP.NET forum.
Thursday, December 3, 2015 1:55 PM
All replies
-
Hi lucamd,
Try below code:
if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onClick"] = "location.href='defult.aspx?id=" + DataBinder.Eval(e.Row.DataItem, "id") + "'"; }
Thanks,
Sabah Shariq
- Edited by Sabah ShariqMVP Thursday, December 3, 2015 12:10 PM
Thursday, December 3, 2015 12:08 PM -
Hi lucarnd,
I think Sabah's code above is referring to the Gridview's own RowDataBound event. For further information, there's a nice example provided by MSDN here:
Best of luck!Thursday, December 3, 2015 1:38 PM -
You are talking Web UI controls, which are discussed at the ASP.NET forum.
Thursday, December 3, 2015 1:55 PM