2009-08-11 8 views
0

est-il possible de créer un champ de modèle avec option de lien en utilisant codebehind.GridView: champ Modèle

+0

Il ressemble à ASP.NET, mais utilisez les balises appropriées. –

+0

J'ai ajouté le tag asp.net –

Répondre

0

Oui! Ajout du gestionnaire OnRowDataBound

MyRowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    if (e.Row.RowType == DataControlRowType.DataRow) 
    { 
      e.Row.Controls.Add(new MyControl(... 
+0

comment ajouter ce champ en utilisant codebehind Details

+0

var hl = new HyperLink(); hl.Attributes ["onclick"] = "javascript: window" + DataBinder.Eval (e.Row.DataItem, "ID") ... e.R.Controls.Add (hl) – Dewfy

Questions connexes