I know this is really basic coding, have searched around here cannot find an answer... I need to change the value of a data cell if a condition is met, the column is say InvoiceStatusID, say it has a value of "O" if that condition is met I just need to change the output to "Invoice" the code I have tried obviously doesn't work and I'm new to ASP.NET.
.. be kind lol, here is what doesn't work:
| Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated |
| Dim dataItem As GridDataItem = Nothing |
| Dim data As Data.DataRowView = Nothing |
| Try |
| If TypeOf e.Item Is GridDataItem Then |
| dataItem = CType(e.Item, GridDataItem) |
| data = CType(dataItem.DataItem, Data.DataRowView) |
| If CType(data.Row.Item("InvoiceStatusID"), String) = "O" Then |
| CType(data.Row.Item("InvoiceStatusID"), TextBox).Text = "Invoice" |
| Else |
| CType(data.Row.Item("InvoiceStatusID"), TextBox).Text = "Closed" |
| End If |
| End If |
| Catch ex As Exception |
| Finally |
| dataItem = Nothing |
| data = Nothing |
| End Try |
| End Sub |