My datagrid has a few columns that display correctly. The are bound meaning I do not set the auto generate at run time. The are bound columns, not template columns.
All that said. Why does this not work. I am trying to format my columns.
Private Sub dgGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgGrid.ItemDataBound
Dim lblField = CType(e.Item.FindControl("CustName", Label)
lblField.text = lblField.text & "-Test"
End Sub
I get an object variable or with block variable not fround on lblField.text = lblField.text & "-Test" line.
Any ideas on where to check for this? I know the column name is good because it displays.
And why is the column considered a label control?
All that said. Why does this not work. I am trying to format my columns.
Private Sub dgGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgGrid.ItemDataBound
Dim lblField = CType(e.Item.FindControl("CustName", Label)
lblField.text = lblField.text & "-Test"
End Sub
I get an object variable or with block variable not fround on lblField.text = lblField.text & "-Test" line.
Any ideas on where to check for this? I know the column name is good because it displays.
And why is the column considered a label control?