Hi,
I have a form that uses the rad gridview control. I have 4 text boxes for a user to key in information about a telephone number. Once they click an add button, I place the information into the rad gridview and clear the 4 text boxes. The user then can enter another telephone number and repeat this process as much as necessary.
The data in the rad gridview is not persisted to the database until the user clicks the save button.
When the user clicks the save button, I want to loop through each row in the rad gridview and gather the information and insert it into the database.
How can I accomplish this task? I was trying to use syntax like this:
For Each item In Me.GridTelephone.Items
// gather the 4 values for the telephone for this item
// and insert it into the database
Next
but the .Items collection of the rad gridview is an IList. This means I cannot determine the type of the data in each row such as a string, integer, boolean, and so on.
How can I determine the type of each item as I loop through them. For example:
public class telephone
IsDefault as boolean
Number as string
Country as integer
End Class
dim phone as new Telephone()
For Each item In Me.GridTelephone.Items
// boolean
phone.IsDefault = item ???
// string
phone.Number = item ???
// integer
phone.Country = item ???
Next
So again, I want to loop through the items and assign the values to a local class which has types.
How can I perform this task?
Bill