I have a datagrid that is pulling a simple query "SELECT * FROM PROJECT" and in the project table, I have multiple fileds that have an ID to another table within the database. One of the ID's is to a representative and could be in the PROJECT table multiple times so I can't really link it to the table in my original select statement.
How can I change the column text from the ID to the name of that representative when the datatable is being populated. I assume that it will have to be in the ItemDataBound routien. I have written a function that will return the name of the representative by passing it the ID so I can use something like this to populate the name.
How can I change the column text from the ID to the name of that representative when the datatable is being populated. I assume that it will have to be in the ItemDataBound routien. I have written a function that will return the name of the representative by passing it the ID so I can use something like this to populate the name.
Functions.GetRepNameByID(e.Item.DataItem(
"PROJECT_ASSIGN_ID"))
Right now the column displays the ID "2" instead of the name "Joe Bob". I would like to display the name instead of the ID.
I tried doing something like this, but it won't let me change the DataItem since it was originally an integer:
If (TypeOf e.Item Is GridDataItem) Then
e.Item.DataItem("PROJECT_ASSIGN_ID") = Functions.GetRepNameByID(e.Item.DataItem("PROJECT_ASSIGN_ID"))
End If
Thanks