我用vb.net問題是綁定在GridView後,我改變了項目stlye填充從數據庫網格視圖,但它給這個錯誤gridview的列項的風格不工作
Index was out of range. Must be non-negative and less than the size of the collection
這裏是我的代碼
Public Sub loadnews()
Try
con.Open()
Dim da As New OdbcDataAdapter("SELECT A.LABEL ""Highest"",A.VALUE||' '||A.DATED ""SML I (Jhang)"",b.VALUE||' '||b.DATED ""SML II (Bhone)"" FROM (SELECT * FROM [email protected]) A, (SELECT * FROM [email protected]) B WHERE A.SRLNUM=B.SRLNUM", con)
Dim ds As New DataSet
da.Fill(ds)
GridView11.DataSource = ds
GridView11.DataBind()
GridView11.Columns(1).ItemStyle.Font.Bold = True
con.Close()
Catch ex As Exception
Response.Write(ex.ToString())
Finally
con.Close()
End Try
End Sub
請任何一個可以幫助我如何讓大膽的0
列
是否加工正確 – user1915635
使用這個答案wihtout ItemStyle –
此進行了大膽的只有拳頭item.cani大膽整列? – user1915635