我必須設置GridView.DataKeyNames (這確實是一個關於語法的字符串數組,在VB.Net問題。)如何填充GridView.DataKeyNames,從循環內構建數組? (String數組語法問題)
我從內發現的PrimaryKey的列名循環,即:
For Each fld As IEntityField In Me.llbDataSource.EntityCollection(0).PrimaryKeyFields
'fld.Name ' this is where the column name is stored, so I have to get this into an array
Next
我不使用此語法。
GridView.DataKeyNames = new string() { "PowRatHP", "Voltage", "Phases", "Poles", "Drive" }
因此,基本上,一個人如何聲明一個字符串數組(根據需要由GridView.DataKeyNames),然後從一個循環內填充數組的元素?
哇,解決方案的大雜燴,謝謝! – tbone 2010-03-11 00:36:15