Ahmed Alaa
New Member
I have a grid view which is populated from a database. I need to make it so that each of the cells in a particular column, when clicked will link through to a second page and pass the cell's text value as a query string (ie link to http://mysite.com/page.aspx?CellText='blah blah blah'). Sounds simple I know but I just can't figure it out!This is what my page looks like at the moment:\[code\]<asp:GridView id="gdvTargets" runat="server" AutoGenerateEditButton="true" OnRowEditing="gdvTargets_RowEdit" OnRowUpdating="gdvTargets_RowUpdating" OnRowUpdated="gdvTargets_RowUpdated" OnRowCancelingEdit="gdvTargets_RowCancelingEdit" cssClass="grid" ><HeaderStyle CssClass="GridHeader"></HeaderStyle>\[/code\]And my c# code behind it:\[code\] protected void Page_Load(object sender, EventArgs e) {year = Request.QueryString["YearSelector"];targetType = Request.QueryString["TargetType"]; gdvTargets.DataSource = this.Ets.Api.Util.Db.GetDataTable("EXEC sp_getTargets " + year + ", " + targetType).Return; gdvTargets.DataBind(); }\[/code\]This results in a table which looks something like this:\[code\]ID System Target 1 Target 2 Target3 Target 40 ALL 10 20 15 102 Machine1 4 7 7 75 Xfgb 45 6 13 8 3\[/code\]I would like the system column to be clickable and link through to a new page but take the name of the system with it. Hope this makes sense! Thanks for your help