2011-06-04 13 views

cevap

12

Kod yazmak

GridView d gibi dosya;

protected void Page_Load(object sender, EventArgs e) 

{ 
    d = new GridView(); 

    d.DataKeyNames = new string[] { "Column1", "Column2" }; 
    form1.Controls.Add(d); 
} 
5

dosya .cs onu ayarlamanız gerekir : böyle

<asp:GridView id="myGrid" DataKeyNames="Id,Name" ... /> 
2

şey:

myGridView.DataKeyNames =new string[]{"PrimaryKeyId"} 
cs
1

Sen GridView DataKeyNames Mülkiyet ayarlayabilirsiniz.

{YourGriViewID}.DataKeyNames = new string[] {"ColV", "Col"}; 
İlgili konular