I have a repeater that initallly retrieve values from a database and the data source is based on the relevant fields names of the query created. The fields in the repeater are populated with one or more fields from the datbase as shown on the ItemDataBound event
Dim t As New TextBox
t = e.Item.FindControl("EmployeeID")
t.text = e.Item.DataItem("ID")
t = e.Item.FindControl("EmployeeName")
t.text = e.Item.DataItem("Surname") + " " + e.Item.DataItem("FirstName")
On a postback, I want to update the repeater, without accessing the database and utilising the existing data in the repeater. I have created a DataTable, one for each of the controls in the repeater which then loops through each of the rows and rebinds to the repeater.
Dim aTable As New System.Data.DataTable
The issue comes on the ItemDataBound event, when the repeater is rebound, where the data source is now different as the field names to the data source are now different.
The only way I believe to solve this issue to determine the data source that populates the repeater and to handle the data source approriately within the ItemDataBound event...
How do I identifiy the data source so I can handle the temDataBound correctly so the data source is repopulated using the datatable?