關於產品的GridView在VB.NET排序:的GridView的AutoGenerateColumns和排序
我有AutoGenerateColumns = True
<asp:GridView ID="GridView1" FooterStyle-BackColor="Aquamarine"
AutoGenerateColumns="true" AllowSorting="true" OnSorting="Gridview1_Sorting"
AllowPaging="True" PageSize="12" OnRowCreated="GridView1_RowCreated"
RowStyle-Wrap="true" runat="server" Width="100%" >
<HeaderStyle BackColor="#E0E0E0" ForeColor="#000000"/>
<FooterStyle BackColor="Aquamarine" />
<emptydatarowstyle backcolor="#CBE0FD" forecolor="#0000FF"/>
</asp:GridView>
我已經聲明瞭排序事件處理(OnSorting="Gridview1_Sorting"
)一個GridView,並能正常工作。
不過,後來我更改列標題(標題,因爲他們是在我從數據庫中獲取的數據集)
GridView1.HeaderRow.Cells(0).Text = "Document" ' "PROC_UID"
GridView1.HeaderRow.Cells(1).Text = "Process Step" ' "PROC_DOC_UID"
當我設置HeaderRow文本,我不能再點擊標題排序(它也不再下劃線)。 我該如何糾正?
最優秀的。需要更換 「」 與 等的HTMLEncode鏈接按鈕文本 昏暗tblThisCell作爲TableCell的 對於每個tblThisCell在e.Row.Cells 嘗試 昏暗lnkButton作爲的LinkButton = tblThisCell.Controls(0) 選擇案例lnkButton.Text 案 「DOC_Bezeichnung」 lnkButton.Text = 「庫門」 最終選擇 抓住EX作爲例外 MyDebug.MsgBox(ex.Message) 結束Try 接下來 結束如果 –